From 1020f67cea66c3bbacb7f738eaf6df39d6ffeb38 Mon Sep 17 00:00:00 2001 From: Brandon Istenes Date: Mon, 4 Apr 2022 10:07:14 -0700 Subject: [PATCH] Delineate public vs private API of esm-framework (#376) --- docs/main/config.md | 17 +- .../configuration/configuration.component.tsx | 2 +- .../src/configuration/configuration.test.tsx | 2 +- .../editable-value.component.tsx | 2 +- .../value-editors/extension-slot-add.tsx | 2 +- .../json-editor/json-editor.component.tsx | 5 +- .../src/ui-editor/ui-editor.tsx | 2 +- .../src/hooks/offline-actions.ts | 2 +- .../offline-actions-mode-button.component.tsx | 2 +- .../offline-actions-page.component.tsx | 2 +- .../offline-actions-table.component.tsx | 2 +- .../offline-actions.component.tsx | 2 +- .../synchronizing-notification.tsx | 2 +- .../choose-locale/change-locale.resource.tsx | 2 +- .../esm-primary-navigation-app/src/offline.ts | 2 +- .../src/root.resource.tsx | 2 +- packages/framework/esm-api/src/fhir.ts | 5 +- .../framework/esm-api/src/openmrs-fetch.ts | 16 +- packages/framework/esm-api/src/public.ts | 11 + .../src/shared-api-objects/current-patient.ts | 6 +- .../src/shared-api-objects/current-user.ts | 6 +- .../src/shared-api-objects/location.ts | 6 +- .../src/shared-api-objects/visit-type.ts | 6 +- .../src/shared-api-objects/visit-utils.ts | 6 +- packages/framework/esm-breadcrumbs/src/db.ts | 17 +- .../framework/esm-breadcrumbs/src/filter.ts | 14 +- .../framework/esm-breadcrumbs/src/types.ts | 2 + .../src/module-config/module-config.ts | 2 + .../esm-config/src/module-config/state.ts | 1 + .../src/navigation/interpolate-string.ts | 4 +- .../esm-config/src/navigation/navigate.ts | 2 +- packages/framework/esm-config/src/public.ts | 12 + .../esm-config/src/validators/validator.ts | 1 + .../esm-config/src/validators/validators.ts | 1 + .../framework/esm-error-handling/src/index.ts | 9 +- .../framework/esm-extensions/src/contexts.ts | 28 - .../esm-extensions/src/extensions.ts | 3 +- .../framework/esm-extensions/src/index.ts | 1 - .../framework/esm-extensions/src/public.ts | 20 + .../framework/esm-extensions/src/render.ts | 1 + .../framework/esm-extensions/src/store.ts | 1 + packages/framework/esm-framework/docs/API.md | 3465 +++++++---------- .../docs/classes/OpenmrsFetchError.md | 6 +- .../esm-framework/docs/enums/VisitMode.md | 6 +- .../esm-framework/docs/enums/VisitStatus.md | 4 +- .../docs/interfaces/AssignedExtension.md | 18 +- .../docs/interfaces/BreadcrumbRegistration.md | 8 +- .../docs/interfaces/BreadcrumbSettings.md | 12 +- .../docs/interfaces/CancelLoading.md | 2 +- .../interfaces/ClearDynamicRoutesMessage.md | 6 +- .../docs/interfaces/ComponentConfig.md | 30 - .../interfaces/ComponentDecoratorOptions.md | 52 - .../docs/interfaces/ConfigurableLinkProps.md | 6 +- .../docs/interfaces/ConnectedExtension.md | 12 +- .../docs/interfaces/CurrentPatientOptions.md | 2 +- .../docs/interfaces/ExtensionInfo.md | 139 - .../docs/interfaces/ExtensionInstance.md | 41 - .../docs/interfaces/ExtensionInternalStore.md | 34 - .../docs/interfaces/ExtensionRegistration.md | 24 +- .../docs/interfaces/ExtensionSlotInfo.md | 64 - .../docs/interfaces/ExtensionSlotState.md | 8 +- .../docs/interfaces/ExtensionStore.md | 6 +- .../docs/interfaces/FHIRRequestObj.md | 6 +- .../interfaces/MessageServiceWorkerResult.md | 10 +- .../docs/interfaces/NavigateOptions.md | 6 +- .../docs/interfaces/NavigationContext.md | 50 - .../interfaces/NetworkRequestFailedEvent.md | 49 - .../docs/interfaces/NotificationDescriptor.md | 74 + .../docs/interfaces/OfflineModeResult.md | 10 +- .../docs/interfaces/OfflinePatientArgs.md | 8 +- .../OfflinePatientDataSyncHandler.md | 8 +- .../interfaces/OfflinePatientDataSyncState.md | 16 +- .../interfaces/OfflinePatientDataSyncStore.md | 8 +- .../interfaces/OfflineSynchronizationStore.md | 30 - .../docs/interfaces/OmrsServiceWorkerEvent.md | 31 - .../interfaces/OmrsServiceWorkerMessage.md | 6 +- .../interfaces/OnImportMapChangedMessage.md | 8 +- .../docs/interfaces/OnlyThePatient.md | 2 +- .../interfaces/OpenmrsReactComponentProps.md | 19 - .../interfaces/OpenmrsReactComponentState.md | 41 - .../interfaces/PatientWithFullResponse.md | 2 +- .../docs/interfaces/QueueItemDescriptor.md | 12 +- .../interfaces/RegisterDynamicRouteMessage.md | 12 +- .../docs/interfaces/RetryOptions.md | 6 +- .../docs/interfaces/ShowNotificationEvent.md | 10 +- .../docs/interfaces/ShowToastEvent.md | 8 +- .../esm-framework/docs/interfaces/SyncItem.md | 18 +- .../docs/interfaces/SyncProcessOptions.md | 16 +- .../docs/interfaces/ToastDescriptor.md | 69 + .../docs/interfaces/ToastNotificationMeta.md | 100 + .../docs/interfaces/UserHasAccessProps.md | 6 +- .../docs/interfaces/VisitItem.md | 8 +- packages/framework/esm-framework/src/index.ts | 16 +- .../framework/esm-framework/src/internal.ts | 11 + packages/framework/esm-globals/src/events.ts | 7 + packages/framework/esm-globals/src/public.ts | 12 + packages/framework/esm-offline/src/mode.ts | 2 + .../esm-offline/src/offline-patient-data.ts | 1 + packages/framework/esm-offline/src/public.ts | 18 + .../src/service-worker-http-headers.ts | 2 + .../src/service-worker-messaging.ts | 1 + packages/framework/esm-offline/src/sync.ts | 1 + packages/framework/esm-offline/src/uuid.ts | 1 + .../esm-react-utils/src/ConfigurableLink.tsx | 2 +- .../esm-react-utils/src/UserHasAccess.tsx | 1 + .../esm-react-utils/src/createUseStore.ts | 1 + .../esm-react-utils/src/getLifecycle.ts | 1 + .../framework/esm-react-utils/src/public.ts | 26 + .../src/useAssignedExtensionIds.ts | 1 + .../src/useAssignedExtensions.ts | 1 + .../esm-react-utils/src/useBodyScrollLock.ts | 1 + .../esm-react-utils/src/useConfig.ts | 1 + .../src/useConnectedExtensions.ts | 1 + .../esm-react-utils/src/useConnectivity.ts | 1 + .../esm-react-utils/src/useCurrentPatient.ts | 1 + .../src/useExtensionSlotMeta.ts | 1 + .../esm-react-utils/src/useExtensionStore.ts | 1 + .../esm-react-utils/src/useLayoutType.ts | 1 + .../esm-react-utils/src/useLocations.tsx | 1 + .../esm-react-utils/src/useOnClickOutside.tsx | 3 +- .../esm-react-utils/src/usePagination.ts | 1 + .../esm-react-utils/src/usePatient.ts | 3 +- .../esm-react-utils/src/useSessionUser.tsx | 1 + .../framework/esm-react-utils/src/useStore.ts | 1 + .../framework/esm-react-utils/src/useVisit.ts | 1 + .../esm-react-utils/src/useVisitTypes.ts | 1 + packages/framework/esm-state/src/public.ts | 7 + packages/framework/esm-state/src/state.ts | 1 + .../esm-styleguide/src/modals/index.tsx | 1 + .../src/notifications/index.tsx | 1 + .../notifications/notification.component.tsx | 1 + .../framework/esm-styleguide/src/public.ts | 12 + .../esm-styleguide/src/toasts/index.tsx | 1 + .../src/toasts/toast.component.tsx | 1 + .../framework/esm-utils/src/age-helpers.tsx | 2 + .../framework/esm-utils/src/omrs-dates.ts | 2 +- packages/framework/esm-utils/src/retry.ts | 2 + packages/framework/esm-utils/src/translate.ts | 1 + packages/framework/esm-utils/src/version.ts | 1 + packages/shell/esm-app-shell/src/apps.ts | 2 +- packages/shell/esm-app-shell/src/index.ts | 2 +- packages/shell/esm-app-shell/src/run.ts | 2 +- 142 files changed, 2020 insertions(+), 2969 deletions(-) create mode 100644 packages/framework/esm-api/src/public.ts create mode 100644 packages/framework/esm-config/src/public.ts delete mode 100644 packages/framework/esm-extensions/src/contexts.ts create mode 100644 packages/framework/esm-extensions/src/public.ts delete mode 100644 packages/framework/esm-framework/docs/interfaces/ComponentConfig.md delete mode 100644 packages/framework/esm-framework/docs/interfaces/ComponentDecoratorOptions.md delete mode 100644 packages/framework/esm-framework/docs/interfaces/ExtensionInfo.md delete mode 100644 packages/framework/esm-framework/docs/interfaces/ExtensionInstance.md delete mode 100644 packages/framework/esm-framework/docs/interfaces/ExtensionInternalStore.md delete mode 100644 packages/framework/esm-framework/docs/interfaces/ExtensionSlotInfo.md delete mode 100644 packages/framework/esm-framework/docs/interfaces/NavigationContext.md delete mode 100644 packages/framework/esm-framework/docs/interfaces/NetworkRequestFailedEvent.md create mode 100644 packages/framework/esm-framework/docs/interfaces/NotificationDescriptor.md delete mode 100644 packages/framework/esm-framework/docs/interfaces/OfflineSynchronizationStore.md delete mode 100644 packages/framework/esm-framework/docs/interfaces/OmrsServiceWorkerEvent.md delete mode 100644 packages/framework/esm-framework/docs/interfaces/OpenmrsReactComponentProps.md delete mode 100644 packages/framework/esm-framework/docs/interfaces/OpenmrsReactComponentState.md create mode 100644 packages/framework/esm-framework/docs/interfaces/ToastDescriptor.md create mode 100644 packages/framework/esm-framework/docs/interfaces/ToastNotificationMeta.md create mode 100644 packages/framework/esm-framework/src/internal.ts create mode 100644 packages/framework/esm-globals/src/public.ts create mode 100644 packages/framework/esm-offline/src/public.ts create mode 100644 packages/framework/esm-react-utils/src/public.ts create mode 100644 packages/framework/esm-state/src/public.ts create mode 100644 packages/framework/esm-styleguide/src/public.ts diff --git a/docs/main/config.md b/docs/main/config.md index b6eb993d0..a0794294e 100644 --- a/docs/main/config.md +++ b/docs/main/config.md @@ -9,10 +9,7 @@ please see the the ## How to make a frontend module configurable -You should use this part of the OpenMRS Frontend Framework to modules configurable. - -Start with `npm install --save-dev @openmrs/esm-framework`. This is a runtime -dependency, so you should also include it in `peerDependencies`. +You should use the OpenMRS Frontend Framework to make modules configurable. The main task is to create a config schema for your module. The config schema is what tells the framework what configuration files should look like, @@ -151,7 +148,7 @@ colorPicker: { ``` For convenience, some common validators are provided out of the box. See the -[API / validators](../../packages/framework/esm-framework/docs/API.md#validators). +[API / validators](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-framework/docs/API.md#validators). #### Arrays @@ -299,7 +296,7 @@ the element, but this may change in future versions. #### `_type` -One of the values from [the `Type` enum](../../packages/framework/esm-framework/docs/enums/Type.md). Used for validation and to help the +One of the values from [the `Type` enum](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-framework/docs/enums/Type.md). Used for validation and to help the implementer tools work with the element. Should always appear alongside `_default`. @@ -316,10 +313,10 @@ Can be used anywhere within the schema structure. An array of validator objects. Some common validators are -provided: [API / validators](../../packages/framework/esm-framework/docs/API.md#const-validators). +provided: [API / validators](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-framework/docs/API.md#config-validation-functions). Custom validators should -be created with the [validator](../../packages/framework/esm-framework/docs/API.md#validator) function. +be created with the [validator](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-framework/docs/API.md#validator) function. Can be used anywhere within the schema structure. @@ -329,6 +326,10 @@ Only valid alongside `_type: Type.Array` or `_type: Type.Object`. A `_default` must also be provided at this level. Value should be an object which is a schema for the values contained in the array or object. +## API Documentation + +See the Config Functions section of the [API docs](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-framework/docs/API.md). + ## The RFC This package was established as the result of diff --git a/packages/apps/esm-implementer-tools-app/src/configuration/configuration.component.tsx b/packages/apps/esm-implementer-tools-app/src/configuration/configuration.component.tsx index 36f6e4e89..75a116709 100644 --- a/packages/apps/esm-implementer-tools-app/src/configuration/configuration.component.tsx +++ b/packages/apps/esm-implementer-tools-app/src/configuration/configuration.component.tsx @@ -12,7 +12,7 @@ import { temporaryConfigStore, useStore, useStoreWithActions, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import { Button, TextInput, diff --git a/packages/apps/esm-implementer-tools-app/src/configuration/configuration.test.tsx b/packages/apps/esm-implementer-tools-app/src/configuration/configuration.test.tsx index 56be7f896..7657c1273 100644 --- a/packages/apps/esm-implementer-tools-app/src/configuration/configuration.test.tsx +++ b/packages/apps/esm-implementer-tools-app/src/configuration/configuration.test.tsx @@ -6,7 +6,7 @@ import { implementerToolsConfigStore, temporaryConfigStore, Type, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import { Configuration } from "./configuration.component"; import { performConceptSearch, diff --git a/packages/apps/esm-implementer-tools-app/src/configuration/interactive-editor/editable-value.component.tsx b/packages/apps/esm-implementer-tools-app/src/configuration/interactive-editor/editable-value.component.tsx index c2b061ee3..7950e698a 100644 --- a/packages/apps/esm-implementer-tools-app/src/configuration/interactive-editor/editable-value.component.tsx +++ b/packages/apps/esm-implementer-tools-app/src/configuration/interactive-editor/editable-value.component.tsx @@ -12,7 +12,7 @@ import { Type, Config, temporaryConfigStore, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import { ValueEditor, CustomValueType } from "./value-editor"; import { implementerToolsStore, ImplementerToolsStore } from "../../store"; import { DisplayValue } from "./display-value"; diff --git a/packages/apps/esm-implementer-tools-app/src/configuration/interactive-editor/value-editors/extension-slot-add.tsx b/packages/apps/esm-implementer-tools-app/src/configuration/interactive-editor/value-editors/extension-slot-add.tsx index 20abd2d69..6ea3a07c6 100644 --- a/packages/apps/esm-implementer-tools-app/src/configuration/interactive-editor/value-editors/extension-slot-add.tsx +++ b/packages/apps/esm-implementer-tools-app/src/configuration/interactive-editor/value-editors/extension-slot-add.tsx @@ -3,7 +3,7 @@ import { MultiSelect } from "carbon-components-react"; import { ExtensionInternalStore, getExtensionInternalStore, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; const extensionInternalStore = getExtensionInternalStore(); diff --git a/packages/apps/esm-implementer-tools-app/src/configuration/json-editor/json-editor.component.tsx b/packages/apps/esm-implementer-tools-app/src/configuration/json-editor/json-editor.component.tsx index 15263288c..ccbb04259 100644 --- a/packages/apps/esm-implementer-tools-app/src/configuration/json-editor/json-editor.component.tsx +++ b/packages/apps/esm-implementer-tools-app/src/configuration/json-editor/json-editor.component.tsx @@ -1,5 +1,8 @@ import React, { useCallback, useEffect, useState } from "react"; -import { temporaryConfigStore, useStore } from "@openmrs/esm-framework"; +import { + temporaryConfigStore, + useStore, +} from "@openmrs/esm-framework/src/internal"; import AceEditor from "react-ace"; import style from "./json-editor.scss"; diff --git a/packages/apps/esm-implementer-tools-app/src/ui-editor/ui-editor.tsx b/packages/apps/esm-implementer-tools-app/src/ui-editor/ui-editor.tsx index 50cabac89..5803a0238 100644 --- a/packages/apps/esm-implementer-tools-app/src/ui-editor/ui-editor.tsx +++ b/packages/apps/esm-implementer-tools-app/src/ui-editor/ui-editor.tsx @@ -5,7 +5,7 @@ import { getExtensionInternalStore, useStore, useStoreWithActions, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import { Button } from "carbon-components-react"; import { Portal } from "./portal"; import { ExtensionOverlay } from "./extension-overlay.component"; diff --git a/packages/apps/esm-offline-tools-app/src/hooks/offline-actions.ts b/packages/apps/esm-offline-tools-app/src/hooks/offline-actions.ts index 7422f4870..6a2b9e9ea 100644 --- a/packages/apps/esm-offline-tools-app/src/hooks/offline-actions.ts +++ b/packages/apps/esm-offline-tools-app/src/hooks/offline-actions.ts @@ -3,7 +3,7 @@ import { getOfflineDb, getSynchronizationItems, SyncItem, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import uniq from "lodash-es/uniq"; import useSWR from "swr"; diff --git a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.component.tsx b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.component.tsx index f39a781cc..cd8d9efdc 100644 --- a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.component.tsx +++ b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-mode-button.component.tsx @@ -5,7 +5,7 @@ import Network20 from "@carbon/icons-react/es/network--3/20"; import { getCurrentOfflineMode, setCurrentOfflineMode, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import styles from "./offline-actions-mode-button.component.scss"; function doNotCloseMenu(ev: React.SyntheticEvent) { diff --git a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-page.component.tsx b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-page.component.tsx index c137aad59..1ac074666 100644 --- a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-page.component.tsx +++ b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-page.component.tsx @@ -4,7 +4,7 @@ import { runSynchronization, useLayoutType, useStore, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import { Button } from "carbon-components-react"; import { useTranslation } from "react-i18next"; import SharedPageLayout from "../components/shared-page-layout.component"; diff --git a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-table.component.tsx b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-table.component.tsx index ededa3fb4..b5f9b632c 100644 --- a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-table.component.tsx +++ b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions-table.component.tsx @@ -29,7 +29,7 @@ import { SyncItem, canBeginEditSynchronizationItemsOfType, beginEditSynchronizationItem, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; export interface SyncItemWithPatient { item: SyncItem; diff --git a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions.component.tsx b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions.component.tsx index 98a6097df..b1030a83c 100644 --- a/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions.component.tsx +++ b/packages/apps/esm-offline-tools-app/src/offline-actions/offline-actions.component.tsx @@ -4,7 +4,7 @@ import { showModal, SyncItem, useStore, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import React from "react"; import { useTranslation } from "react-i18next"; import OfflineActionsTable from "./offline-actions-table.component"; diff --git a/packages/apps/esm-offline-tools-app/src/offline-actions/synchronizing-notification.tsx b/packages/apps/esm-offline-tools-app/src/offline-actions/synchronizing-notification.tsx index 009483535..3c7a9c6e5 100644 --- a/packages/apps/esm-offline-tools-app/src/offline-actions/synchronizing-notification.tsx +++ b/packages/apps/esm-offline-tools-app/src/offline-actions/synchronizing-notification.tsx @@ -4,7 +4,7 @@ import { OfflineSynchronizationStore, showNotification, useStore, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import { getI18n, useTranslation } from "react-i18next"; import { Loading, NotificationActionButton } from "carbon-components-react"; import styles from "./synchronizing-notification.styles.scss"; diff --git a/packages/apps/esm-primary-navigation-app/src/components/choose-locale/change-locale.resource.tsx b/packages/apps/esm-primary-navigation-app/src/components/choose-locale/change-locale.resource.tsx index 9666db376..99b60b163 100644 --- a/packages/apps/esm-primary-navigation-app/src/components/choose-locale/change-locale.resource.tsx +++ b/packages/apps/esm-primary-navigation-app/src/components/choose-locale/change-locale.resource.tsx @@ -3,7 +3,7 @@ import { queueSynchronizationItemFor, getSessionLocation, setSessionLocation, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import { userPropertyChange } from "../../constants"; export type PostUserProperties = ( diff --git a/packages/apps/esm-primary-navigation-app/src/offline.ts b/packages/apps/esm-primary-navigation-app/src/offline.ts index ded89a29e..9ce03c269 100644 --- a/packages/apps/esm-primary-navigation-app/src/offline.ts +++ b/packages/apps/esm-primary-navigation-app/src/offline.ts @@ -2,7 +2,7 @@ import { refetchCurrentUser, getLoggedInUser, SyncProcessOptions, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import { postUserPropertiesOnline } from "./components/choose-locale/change-locale.resource"; export async function syncUserLanguagePreference( diff --git a/packages/apps/esm-primary-navigation-app/src/root.resource.tsx b/packages/apps/esm-primary-navigation-app/src/root.resource.tsx index 34f51e685..7b4bf89b2 100644 --- a/packages/apps/esm-primary-navigation-app/src/root.resource.tsx +++ b/packages/apps/esm-primary-navigation-app/src/root.resource.tsx @@ -3,7 +3,7 @@ import { getCurrentUser, getSynchronizationItemsFor, openmrsObservableFetch, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import { mergeMap } from "rxjs/operators"; import { userPropertyChange } from "./constants"; diff --git a/packages/framework/esm-api/src/fhir.ts b/packages/framework/esm-api/src/fhir.ts index c8279e9a9..910fbd55a 100644 --- a/packages/framework/esm-api/src/fhir.ts +++ b/packages/framework/esm-api/src/fhir.ts @@ -1,7 +1,4 @@ -/** - * @module - * @category API - */ +/** @module @category API */ import { openmrsFetch, FetchHeaders, OpenmrsFetchError } from "./openmrs-fetch"; import type { FhirClient } from "./types/fhir"; diff --git a/packages/framework/esm-api/src/openmrs-fetch.ts b/packages/framework/esm-api/src/openmrs-fetch.ts index d9dac1fbf..b12ca32b0 100644 --- a/packages/framework/esm-api/src/openmrs-fetch.ts +++ b/packages/framework/esm-api/src/openmrs-fetch.ts @@ -1,8 +1,4 @@ -/** - * @module - * @category API - */ - +/** @module @category API */ import { Observable } from "rxjs"; import isPlainObject from "lodash-es/isPlainObject"; import { getConfig, navigate } from "@openmrs/esm-config"; @@ -10,6 +6,16 @@ import { FetchResponse } from "./types"; export const sessionEndpoint = "/ws/rest/v1/session"; +/** + * Append `path` to the OpenMRS SPA base. + * + * #### Example + * + * ```ts + * makeUrl('/foo/bar'); + * // => '/openmrs/foo/bar' + * ``` + */ export function makeUrl(path: string) { return window.openmrsBase + path; } diff --git a/packages/framework/esm-api/src/public.ts b/packages/framework/esm-api/src/public.ts new file mode 100644 index 000000000..8097d20b9 --- /dev/null +++ b/packages/framework/esm-api/src/public.ts @@ -0,0 +1,11 @@ +export * from "./types"; +export * from "./openmrs-fetch"; +export * from "./fhir"; + +export * from "./shared-api-objects/current-user"; +export * from "./shared-api-objects/current-patient"; +export * from "./shared-api-objects/visit-utils"; +export * from "./shared-api-objects/visit-type"; +export * from "./shared-api-objects/location"; + +export * from "./openmrs-backend-dependencies"; diff --git a/packages/framework/esm-api/src/shared-api-objects/current-patient.ts b/packages/framework/esm-api/src/shared-api-objects/current-patient.ts index ffe331b3e..b658d10b9 100644 --- a/packages/framework/esm-api/src/shared-api-objects/current-patient.ts +++ b/packages/framework/esm-api/src/shared-api-objects/current-patient.ts @@ -1,8 +1,4 @@ -/** - * @module - * @category API - */ - +/** @module @category API */ import { fhir } from "../fhir"; import { FetchResponse } from "../types"; diff --git a/packages/framework/esm-api/src/shared-api-objects/current-user.ts b/packages/framework/esm-api/src/shared-api-objects/current-user.ts index 313bf061e..fc5715518 100644 --- a/packages/framework/esm-api/src/shared-api-objects/current-user.ts +++ b/packages/framework/esm-api/src/shared-api-objects/current-user.ts @@ -1,8 +1,4 @@ -/** - * @module - * @category API - */ - +/** @module @category API */ import { Observable, ReplaySubject } from "rxjs"; import { filter, map, tap, mergeAll } from "rxjs/operators"; import { openmrsFetch, sessionEndpoint } from "../openmrs-fetch"; diff --git a/packages/framework/esm-api/src/shared-api-objects/location.ts b/packages/framework/esm-api/src/shared-api-objects/location.ts index 400efcc6c..ada9ac0ae 100644 --- a/packages/framework/esm-api/src/shared-api-objects/location.ts +++ b/packages/framework/esm-api/src/shared-api-objects/location.ts @@ -1,8 +1,4 @@ -/** - * @module - * @category API - */ - +/** @module @category API */ import { Observable } from "rxjs"; import { map, take } from "rxjs/operators"; import { openmrsObservableFetch } from "../openmrs-fetch"; diff --git a/packages/framework/esm-api/src/shared-api-objects/visit-type.ts b/packages/framework/esm-api/src/shared-api-objects/visit-type.ts index 1fc86feda..25b819ee5 100644 --- a/packages/framework/esm-api/src/shared-api-objects/visit-type.ts +++ b/packages/framework/esm-api/src/shared-api-objects/visit-type.ts @@ -1,8 +1,4 @@ -/** - * @module - * @category API - */ - +/** @module @category API */ import { Observable } from "rxjs"; import { map, take } from "rxjs/operators"; import { openmrsObservableFetch } from "../openmrs-fetch"; diff --git a/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts b/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts index b283356d5..17c541610 100644 --- a/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts +++ b/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts @@ -1,8 +1,4 @@ -/** - * @module - * @category API - */ - +/** @module @category API */ import { Observable, BehaviorSubject } from "rxjs"; import { take, map } from "rxjs/operators"; import { openmrsObservableFetch } from "../openmrs-fetch"; diff --git a/packages/framework/esm-breadcrumbs/src/db.ts b/packages/framework/esm-breadcrumbs/src/db.ts index 21944e04d..a25424a93 100644 --- a/packages/framework/esm-breadcrumbs/src/db.ts +++ b/packages/framework/esm-breadcrumbs/src/db.ts @@ -1,3 +1,4 @@ +/** @module @category Breadcrumb */ import { pathToRegexp } from "path-to-regexp"; import { createGlobalStore } from "@openmrs/esm-state"; import { BreadcrumbSettings, BreadcrumbRegistration } from "./types"; @@ -17,21 +18,10 @@ function getMatcher(settings: BreadcrumbSettings) { } } -/** - * - * @param breadcrumb - * @returns - * @category Breadcrumb - */ export function registerBreadcrumb(breadcrumb: BreadcrumbSettings) { return registerBreadcrumbs([breadcrumb]); } -/** - * - * @param breadcrumbs - * @category Breadcrumb - */ export function registerBreadcrumbs(breadcrumbs: Array) { const prevBreadcrumbs = getBreadcrumbs(); const newBreadcrumbs = breadcrumbs.map((settings) => ({ @@ -42,11 +32,6 @@ export function registerBreadcrumbs(breadcrumbs: Array) { store.setState(nextBreadcrumbs, true); } -/** - * - * @returns - * @category Breadcrumb - */ export function getBreadcrumbs() { return store.getState(); } diff --git a/packages/framework/esm-breadcrumbs/src/filter.ts b/packages/framework/esm-breadcrumbs/src/filter.ts index d78948cfd..c6bf4ccd7 100644 --- a/packages/framework/esm-breadcrumbs/src/filter.ts +++ b/packages/framework/esm-breadcrumbs/src/filter.ts @@ -1,3 +1,4 @@ +/** @module @category Breadcrumb */ import { getBreadcrumbs } from "./db"; import { BreadcrumbRegistration } from "./types"; @@ -39,13 +40,6 @@ function getNext( return undefined; } -/** - * - * @param list - * @param path - * @returns - * @category Breadcrumb - */ export function filterBreadcrumbs( list: Array, path: string @@ -69,12 +63,6 @@ export function filterBreadcrumbs( return []; } -/** - * - * @param path - * @returns - * @category Breadcrumb - */ export function getBreadcrumbsFor(path: string) { const breadcrumbs = getBreadcrumbs(); return filterBreadcrumbs(breadcrumbs, path); diff --git a/packages/framework/esm-breadcrumbs/src/types.ts b/packages/framework/esm-breadcrumbs/src/types.ts index e6ac13730..5153467d5 100644 --- a/packages/framework/esm-breadcrumbs/src/types.ts +++ b/packages/framework/esm-breadcrumbs/src/types.ts @@ -1,3 +1,5 @@ +/** @module @category Breadcrumb */ + export interface BreadcrumbSettings { /** * Gets the path of breadcrumb for navigation purposes. diff --git a/packages/framework/esm-config/src/module-config/module-config.ts b/packages/framework/esm-config/src/module-config/module-config.ts index 1be269a5a..8a9ce1205 100644 --- a/packages/framework/esm-config/src/module-config/module-config.ts +++ b/packages/framework/esm-config/src/module-config/module-config.ts @@ -1,3 +1,4 @@ +/** @module @category Config */ import { clone, reduce, mergeDeepRight, equals } from "ramda"; import { Config, @@ -271,6 +272,7 @@ export function getConfig(moduleName: string): Promise { * @param providedConfig an object of config values (without the top-level module name) * @param keyPathContext a dot-deparated string which helps the user figure out where * the provided config came from + * @internal */ export function processConfig( schema: ConfigSchema, diff --git a/packages/framework/esm-config/src/module-config/state.ts b/packages/framework/esm-config/src/module-config/state.ts index cd9e4c0df..15e2562ca 100644 --- a/packages/framework/esm-config/src/module-config/state.ts +++ b/packages/framework/esm-config/src/module-config/state.ts @@ -1,3 +1,4 @@ +/** @module @category Config */ import { createGlobalStore, getGlobalStore } from "@openmrs/esm-state"; import { Config, diff --git a/packages/framework/esm-config/src/navigation/interpolate-string.ts b/packages/framework/esm-config/src/navigation/interpolate-string.ts index 9d2dabc81..703e18568 100644 --- a/packages/framework/esm-config/src/navigation/interpolate-string.ts +++ b/packages/framework/esm-config/src/navigation/interpolate-string.ts @@ -1,3 +1,5 @@ +/** @module @category Navigation */ + function trimTrailingSlash(str: string) { return str.replace(/\/$/, ""); } @@ -9,7 +11,6 @@ function trimTrailingSlash(str: string) { * parameters in configurable URLs. * * @param template A string to interpolate - * @category Navigation */ export function interpolateUrl(template: string): string { const openmrsSpaBase = trimTrailingSlash(window.getOpenmrsSpaBase()); @@ -36,7 +37,6 @@ export function interpolateUrl(template: string): string { * * @param template With optional params wrapped in `${ }` * @param params Values to interpolate into the string template - * @category Navigation */ export function interpolateString(template: string, params: object): string { const names = Object.keys(params); diff --git a/packages/framework/esm-config/src/navigation/navigate.ts b/packages/framework/esm-config/src/navigation/navigate.ts index 5a4c988ad..9e3223d29 100644 --- a/packages/framework/esm-config/src/navigation/navigate.ts +++ b/packages/framework/esm-config/src/navigation/navigate.ts @@ -1,3 +1,4 @@ +/** @module @category Navigation */ import { navigateToUrl } from "single-spa"; import { interpolateUrl } from "./interpolate-string"; import type {} from "@openmrs/esm-globals"; @@ -24,7 +25,6 @@ export interface NavigateOptions { * @param to 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. - * @category Navigation */ export function navigate({ to }: NavigateOptions): void { const openmrsSpaBase = trimTrailingSlash(window.getOpenmrsSpaBase()); diff --git a/packages/framework/esm-config/src/public.ts b/packages/framework/esm-config/src/public.ts new file mode 100644 index 000000000..62d9dbbf4 --- /dev/null +++ b/packages/framework/esm-config/src/public.ts @@ -0,0 +1,12 @@ +export * from "./types"; +export * from "./navigation/interpolate-string"; +export * from "./navigation/navigate"; +export * from "./validators/validator"; +export * from "./validators/validators"; +export { + defineConfigSchema, + defineExtensionConfigSchema, + provide, + getConfig, +} from "./module-config/module-config"; +export { getConfigStore, ConfigStore } from "./module-config/state"; diff --git a/packages/framework/esm-config/src/validators/validator.ts b/packages/framework/esm-config/src/validators/validator.ts index df898a3f8..19c9d6a02 100644 --- a/packages/framework/esm-config/src/validators/validator.ts +++ b/packages/framework/esm-config/src/validators/validator.ts @@ -1,3 +1,4 @@ +/** @module @category Config Validation */ import { Validator, ValidatorFunction } from "../types"; export function validator( diff --git a/packages/framework/esm-config/src/validators/validators.ts b/packages/framework/esm-config/src/validators/validators.ts index be81562f5..720cea0ae 100644 --- a/packages/framework/esm-config/src/validators/validators.ts +++ b/packages/framework/esm-config/src/validators/validators.ts @@ -1,3 +1,4 @@ +/** @module @category Config Validation */ import { validator } from "./validator"; /** diff --git a/packages/framework/esm-error-handling/src/index.ts b/packages/framework/esm-error-handling/src/index.ts index 37ae8b305..7a7b20388 100644 --- a/packages/framework/esm-error-handling/src/index.ts +++ b/packages/framework/esm-error-handling/src/index.ts @@ -1,13 +1,6 @@ +/** @module @category Error Handling */ import { dispatchNotificationShown } from "@openmrs/esm-globals"; -export function handleApiError() { - return (incomingResponseErr) => { - setTimeout(() => { - throw incomingResponseErr; - }); - }; -} - window.onerror = function () { dispatchNotificationShown({ description: "Oops! An unexpected error occurred.", diff --git a/packages/framework/esm-extensions/src/contexts.ts b/packages/framework/esm-extensions/src/contexts.ts deleted file mode 100644 index 69792b3b9..000000000 --- a/packages/framework/esm-extensions/src/contexts.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { navigate } from "@openmrs/esm-config"; - -export type NavigationContextType = "workspace" | "dialog" | "link"; - -export interface NavigationContext { - type: NavigationContextType; - handler(link: string, state: T): boolean; -} - -/** - * @deprecated use `navigate` directly - */ -export function switchTo( - _type: NavigationContextType, - link: string, - _state?: T -) { - navigate({ to: link }); -} - -/** - * @deprecated don't use - */ -export function pushNavigationContext(_context: NavigationContext) { - return () => { - //STUB - remove soon - }; -} diff --git a/packages/framework/esm-extensions/src/extensions.ts b/packages/framework/esm-extensions/src/extensions.ts index 36d8004ec..9b0cd4488 100644 --- a/packages/framework/esm-extensions/src/extensions.ts +++ b/packages/framework/esm-extensions/src/extensions.ts @@ -1,4 +1,5 @@ -/** +/** @module @category Extension */ +/* * We have the following extension modes: * * - attached (set via code in form of: attach, detach, ...) diff --git a/packages/framework/esm-extensions/src/index.ts b/packages/framework/esm-extensions/src/index.ts index 97a6b59be..d7dae411f 100644 --- a/packages/framework/esm-extensions/src/index.ts +++ b/packages/framework/esm-extensions/src/index.ts @@ -1,4 +1,3 @@ -export * from "./contexts"; export * from "./store"; export * from "./extensions"; export * from "./helpers"; diff --git a/packages/framework/esm-extensions/src/public.ts b/packages/framework/esm-extensions/src/public.ts new file mode 100644 index 000000000..26cf8bf75 --- /dev/null +++ b/packages/framework/esm-extensions/src/public.ts @@ -0,0 +1,20 @@ +export { + getExtensionNameFromId, + registerExtension, + attach, + detach, + detachAll, + getConnectedExtensions, + getAssignedExtensions, + registerExtensionSlot, +} from "./extensions"; +export { renderExtension, CancelLoading } from "./render"; +export { + ExtensionMeta, + ExtensionRegistration, + AssignedExtension, + ConnectedExtension, + ExtensionStore, + ExtensionSlotState, + getExtensionStore, +} from "./store"; diff --git a/packages/framework/esm-extensions/src/render.ts b/packages/framework/esm-extensions/src/render.ts index 87ab5ec10..6b85c1fe6 100644 --- a/packages/framework/esm-extensions/src/render.ts +++ b/packages/framework/esm-extensions/src/render.ts @@ -1,3 +1,4 @@ +/** @module @category Extension */ import { Lifecycle } from "@openmrs/esm-globals"; import { mountRootParcel, Parcel } from "single-spa"; import { getExtensionNameFromId, getExtensionRegistration } from "./extensions"; diff --git a/packages/framework/esm-extensions/src/store.ts b/packages/framework/esm-extensions/src/store.ts index 965ac1ebe..2b23e1c80 100644 --- a/packages/framework/esm-extensions/src/store.ts +++ b/packages/framework/esm-extensions/src/store.ts @@ -1,3 +1,4 @@ +/** @module @category Extension */ import isEqual from "lodash-es/isEqual"; import { configExtensionStore, diff --git a/packages/framework/esm-framework/docs/API.md b/packages/framework/esm-framework/docs/API.md index 818bbfb26..a59947b65 100644 --- a/packages/framework/esm-framework/docs/API.md +++ b/packages/framework/esm-framework/docs/API.md @@ -22,6 +22,12 @@ - [toLocationObject](API.md#tolocationobject) - [toVisitTypeObject](API.md#tovisittypeobject) - [updateVisit](API.md#updatevisit) +- [useCurrentPatient](API.md#usecurrentpatient) +- [useLocations](API.md#uselocations) +- [usePatient](API.md#usepatient) +- [useSessionUser](API.md#usesessionuser) +- [useVisit](API.md#usevisit) +- [useVisitTypes](API.md#usevisittypes) - [userHasAccess](API.md#userhasaccess) ### Breadcrumb Functions @@ -32,7 +38,22 @@ - [registerBreadcrumb](API.md#registerbreadcrumb) - [registerBreadcrumbs](API.md#registerbreadcrumbs) -### Date and time Functions +### Config Functions + +- [defineConfigSchema](API.md#defineconfigschema) +- [defineExtensionConfigSchema](API.md#defineextensionconfigschema) +- [getConfig](API.md#getconfig) +- [provide](API.md#provide) +- [useConfig](API.md#useconfig) + +### Config Validation Functions + +- [inRange](API.md#inrange) +- [isUrl](API.md#isurl) +- [isUrlWithTemplateParameters](API.md#isurlwithtemplateparameters) +- [validator](API.md#validator) + +### Date and Time Functions - [formatDate](API.md#formatdate) - [formatDatetime](API.md#formatdatetime) @@ -48,121 +69,92 @@ - [toOmrsTimeString24](API.md#toomrstimestring24) - [toOmrsYearlessDateFormat](API.md#toomrsyearlessdateformat) +### Error Handling Functions + +- [createErrorHandler](API.md#createerrorhandler) +- [reportError](API.md#reporterror) + +### Extension Functions + +- [attach](API.md#attach) +- [detach](API.md#detach) +- [detachAll](API.md#detachall) +- [getAssignedExtensions](API.md#getassignedextensions) +- [getConnectedExtensions](API.md#getconnectedextensions) +- [getExtensionNameFromId](API.md#getextensionnamefromid) +- [getExtensionStore](API.md#getextensionstore) +- [renderExtension](API.md#renderextension) +- [useAssignedExtensionIds](API.md#useassignedextensionids) +- [useAssignedExtensions](API.md#useassignedextensions) +- [useConnectedExtensions](API.md#useconnectedextensions) +- [useExtensionSlotMeta](API.md#useextensionslotmeta) +- [useExtensionStore](API.md#useextensionstore) + +### Framework Functions + +- [getAsyncExtensionLifecycle](API.md#getasyncextensionlifecycle) +- [getAsyncLifecycle](API.md#getasynclifecycle) +- [getLifecycle](API.md#getlifecycle) +- [getSyncLifecycle](API.md#getsynclifecycle) + ### Navigation Functions - [interpolateString](API.md#interpolatestring) - [interpolateUrl](API.md#interpolateurl) -- [isUrl](API.md#isurl) -- [isUrlWithTemplateParameters](API.md#isurlwithtemplateparameters) - [navigate](API.md#navigate) -### Other Functions +### Offline Functions -- [activateOfflineCapability](API.md#activateofflinecapability) -- [age](API.md#age) -- [attach](API.md#attach) - [beginEditSynchronizationItem](API.md#begineditsynchronizationitem) - [canBeginEditSynchronizationItemsOfType](API.md#canbegineditsynchronizationitemsoftype) -- [checkStatus](API.md#checkstatus) -- [checkStatusFor](API.md#checkstatusfor) -- [createErrorHandler](API.md#createerrorhandler) -- [createGlobalStore](API.md#createglobalstore) -- [createUseStore](API.md#createusestore) -- [daysIntoYear](API.md#daysintoyear) -- [defineConfigSchema](API.md#defineconfigschema) -- [defineExtensionConfigSchema](API.md#defineextensionconfigschema) - [deleteSynchronizationItem](API.md#deletesynchronizationitem) -- [detach](API.md#detach) -- [detachAll](API.md#detachall) -- [dispatchConnectivityChanged](API.md#dispatchconnectivitychanged) -- [dispatchNetworkRequestFailed](API.md#dispatchnetworkrequestfailed) -- [dispatchNotificationShown](API.md#dispatchnotificationshown) -- [dispatchPrecacheStaticDependencies](API.md#dispatchprecachestaticdependencies) - [generateOfflineUuid](API.md#generateofflineuuid) -- [getAppState](API.md#getappstate) -- [getAssignedExtensions](API.md#getassignedextensions) -- [getAsyncExtensionLifecycle](API.md#getasyncextensionlifecycle) -- [getAsyncLifecycle](API.md#getasynclifecycle) -- [getConfig](API.md#getconfig) -- [getConnectedExtensions](API.md#getconnectedextensions) - [getCurrentOfflineMode](API.md#getcurrentofflinemode) -- [getCustomProps](API.md#getcustomprops) -- [getExtensionNameFromId](API.md#getextensionnamefromid) -- [getExtensionRegistration](API.md#getextensionregistration) -- [getExtensionRegistrationFrom](API.md#getextensionregistrationfrom) -- [getExtensionStore](API.md#getextensionstore) -- [getGlobalStore](API.md#getglobalstore) -- [getLifecycle](API.md#getlifecycle) - [getOfflinePatientDataStore](API.md#getofflinepatientdatastore) -- [getOfflineSynchronizationStore](API.md#getofflinesynchronizationstore) -- [getOmrsServiceWorker](API.md#getomrsserviceworker) -- [getSyncLifecycle](API.md#getsynclifecycle) - [getSynchronizationItem](API.md#getsynchronizationitem) - [getSynchronizationItems](API.md#getsynchronizationitems) -- [getSynchronizationItemsFor](API.md#getsynchronizationitemsfor) -- [handleApiError](API.md#handleapierror) -- [inRange](API.md#inrange) -- [integrateBreakpoints](API.md#integratebreakpoints) - [isOfflineUuid](API.md#isofflineuuid) -- [isSameDay](API.md#issameday) -- [isVersionSatisfied](API.md#isversionsatisfied) - [loadPersistedPatientDataSyncState](API.md#loadpersistedpatientdatasyncstate) - [messageOmrsServiceWorker](API.md#messageomrsserviceworker) -- [openmrsComponentDecorator](API.md#openmrscomponentdecorator) -- [patchXMLHttpRequest](API.md#patchxmlhttprequest) -- [processConfig](API.md#processconfig) -- [provide](API.md#provide) -- [pushNavigationContext](API.md#pushnavigationcontext) - [queueSynchronizationItem](API.md#queuesynchronizationitem) -- [queueSynchronizationItemFor](API.md#queuesynchronizationitemfor) - [registerOfflinePatientHandler](API.md#registerofflinepatienthandler) -- [registerOmrsServiceWorker](API.md#registeromrsserviceworker) -- [renderExtension](API.md#renderextension) -- [renderInlineNotifications](API.md#renderinlinenotifications) -- [renderLoadingSpinner](API.md#renderloadingspinner) -- [renderModals](API.md#rendermodals) -- [renderToasts](API.md#rendertoasts) -- [reportError](API.md#reporterror) -- [retry](API.md#retry) -- [runSynchronization](API.md#runsynchronization) -- [setCurrentOfflineMode](API.md#setcurrentofflinemode) - [setupOfflineSync](API.md#setupofflinesync) -- [setupPaths](API.md#setuppaths) -- [setupUtils](API.md#setuputils) -- [showModal](API.md#showmodal) -- [showNotification](API.md#shownotification) -- [showToast](API.md#showtoast) - [subscribeConnectivity](API.md#subscribeconnectivity) - [subscribeConnectivityChanged](API.md#subscribeconnectivitychanged) -- [subscribeNetworkRequestFailed](API.md#subscribenetworkrequestfailed) -- [subscribeNotificationShown](API.md#subscribenotificationshown) - [subscribePrecacheStaticDependencies](API.md#subscribeprecachestaticdependencies) +- [syncOfflinePatientData](API.md#syncofflinepatientdata) +- [useConnectivity](API.md#useconnectivity) + +### Store Functions + +- [createGlobalStore](API.md#createglobalstore) +- [createUseStore](API.md#createusestore) +- [getAppState](API.md#getappstate) +- [getGlobalStore](API.md#getglobalstore) - [subscribeTo](API.md#subscribeto) +- [useStore](API.md#usestore) +- [useStoreWithActions](API.md#usestorewithactions) + +### UI Functions + +- [showModal](API.md#showmodal) +- [showNotification](API.md#shownotification) +- [showToast](API.md#showtoast) +- [subscribeNotificationShown](API.md#subscribenotificationshown) - [subscribeToastShown](API.md#subscribetoastshown) -- [switchTo](API.md#switchto) -- [syncOfflinePatientData](API.md#syncofflinepatientdata) -- [translateFrom](API.md#translatefrom) -- [useAssignedExtensionIds](API.md#useassignedextensionids) -- [useAssignedExtensions](API.md#useassignedextensions) - [useBodyScrollLock](API.md#usebodyscrolllock) -- [useConfig](API.md#useconfig) -- [useConnectedExtensions](API.md#useconnectedextensions) -- [useConnectivity](API.md#useconnectivity) -- [useCurrentPatient](API.md#usecurrentpatient) -- [useExtensionSlotMeta](API.md#useextensionslotmeta) -- [useExtensionStore](API.md#useextensionstore) -- [useForceUpdate](API.md#useforceupdate) - [useLayoutType](API.md#uselayouttype) -- [useLocations](API.md#uselocations) - [useOnClickOutside](API.md#useonclickoutside) - [usePagination](API.md#usepagination) -- [usePatient](API.md#usepatient) -- [useSessionUser](API.md#usesessionuser) -- [useStore](API.md#usestore) -- [useStoreWithActions](API.md#usestorewithactions) -- [useVisit](API.md#usevisit) -- [useVisitTypes](API.md#usevisittypes) -- [validator](API.md#validator) + +### Utility Functions + +- [age](API.md#age) +- [daysIntoYear](API.md#daysintoyear) +- [isSameDay](API.md#issameday) +- [isVersionSatisfied](API.md#isversionsatisfied) +- [retry](API.md#retry) +- [translateFrom](API.md#translatefrom) ## API Type aliases @@ -172,7 +164,17 @@ #### Defined in -[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) +[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) + +___ + +### NullablePatient + +Ƭ **NullablePatient**: `fhir.Patient` \| ``null`` + +#### Defined in + +[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) ___ @@ -182,11 +184,11 @@ ___ #### Defined in -[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) +[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) ___ -## Date and time Type aliases +## Date and Time Type aliases ### DateInput @@ -227,61 +229,7 @@ ___ ___ -## Other Type aliases - -### Actions - -Ƭ **Actions**: `Function` \| { `[key: string]`: `Function`; } - -#### Defined in - -[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) - -___ - -### BoundActions - -Ƭ **BoundActions**: `Object` - -#### Index signature - -▪ [key: `string`]: `BoundAction` - -#### Defined in - -[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) - -___ - -### ConfigValue - -Ƭ **ConfigValue**: `string` \| `number` \| `boolean` \| `void` \| `any`[] \| `object` - -#### Defined in - -[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) - -___ - -### ExtensionSlotProps - -Ƭ **ExtensionSlotProps**: [`ExtensionSlotBaseProps`](interfaces/ExtensionSlotBaseProps.md) & `React.HTMLAttributes`<`HTMLDivElement`\> - -#### Defined in - -[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) - -___ - -### KnownOmrsServiceWorkerEvents - -Ƭ **KnownOmrsServiceWorkerEvents**: [`NetworkRequestFailedEvent`](interfaces/NetworkRequestFailedEvent.md) - -#### Defined in - -[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) - -___ +## Offline Type aliases ### KnownOmrsServiceWorkerMessages @@ -289,37 +237,7 @@ ___ #### Defined in -[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) - -___ - -### LayoutType - -Ƭ **LayoutType**: ``"tablet"`` \| ``"phone"`` \| ``"desktop"`` - -#### Defined in - -[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) - -___ - -### LoggedInUserData - -Ƭ **LoggedInUserData**: [`UnauthenticatedUser`](interfaces/UnauthenticatedUser.md) & { `user?`: [`LoggedInUser`](interfaces/LoggedInUser.md) } - -#### Defined in - -[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) - -___ - -### NavigationContextType - -Ƭ **NavigationContextType**: ``"workspace"`` \| ``"dialog"`` \| ``"link"`` - -#### Defined in - -[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) +[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) ___ @@ -329,7 +247,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -344,7 +262,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -354,7 +272,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -375,43 +293,39 @@ HTTP requests with these headers are handled in a special way by the SPA's servi #### Defined in -[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) +[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) ___ -### ProcessSyncItem +## Other Type aliases -Ƭ **ProcessSyncItem**<`T`\>: (`item`: `T`, `options`: [`SyncProcessOptions`](interfaces/SyncProcessOptions.md)<`T`\>) => `Promise`<`any`\> +### ConfigValue -#### Type parameters +Ƭ **ConfigValue**: `string` \| `number` \| `boolean` \| `void` \| `any`[] \| `object` -| Name | -| :------ | -| `T` | +#### Defined in -#### Type declaration +[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) -▸ (`item`, `options`): `Promise`<`any`\> +___ -A function which, when invoked, performs the actual client-server synchronization of the given -`item` (which is the actual data to be synchronized). -The function receives additional `options` which provide additional data that can be used -for synchronizing. +### ExtensionSlotProps -##### Parameters +Ƭ **ExtensionSlotProps**: [`ExtensionSlotBaseProps`](interfaces/ExtensionSlotBaseProps.md) & `React.HTMLAttributes`<`HTMLDivElement`\> -| Name | Type | -| :------ | :------ | -| `item` | `T` | -| `options` | [`SyncProcessOptions`](interfaces/SyncProcessOptions.md)<`T`\> | +#### Defined in -##### Returns +[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) -`Promise`<`any`\> +___ + +### LoggedInUserData + +Ƭ **LoggedInUserData**: [`UnauthenticatedUser`](interfaces/UnauthenticatedUser.md) & { `user?`: [`LoggedInUser`](interfaces/LoggedInUser.md) } #### Defined in -[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) +[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) ___ @@ -498,171 +412,180 @@ ___ [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) -## API Variables +___ -### defaultVisitCustomRepresentation +## Store Type aliases -• **defaultVisitCustomRepresentation**: `string` +### Actions + +Ƭ **Actions**: `Function` \| { `[key: string]`: `Function`; } #### Defined in -[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) +[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) ___ -### fhir +### BoundActions -• **fhir**: `FhirClient` +Ƭ **BoundActions**: `Object` -The `fhir` object is [an instance of fhir.js](https://github.com/FHIR/fhir.js) -that can be used to call FHIR-compliant OpenMRS APIs. See -[the docs for fhir.js](https://github.com/FHIR/fhir.js) for more info -and example usage. +#### Index signature + +▪ [key: `string`]: `BoundAction` #### Defined in -[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) +[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) ___ -### fhirBaseUrl +## UI Type aliases -• **fhirBaseUrl**: ``"/ws/fhir2/R4"`` +### InlineNotificationType + +Ƭ **InlineNotificationType**: ``"error"`` \| ``"info"`` \| ``"info-square"`` \| ``"success"`` \| ``"warning"`` \| ``"warning-alt"`` #### Defined in -[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) +[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) ___ -### getStartedVisit +### LayoutType -• **getStartedVisit**: `BehaviorSubject`<``null`` \| [`VisitItem`](interfaces/VisitItem.md)\> +Ƭ **LayoutType**: ``"tablet"`` \| ``"phone"`` \| ``"desktop"`` #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:78](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L78) +[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) ___ -### sessionEndpoint +### ToastType -• **sessionEndpoint**: ``"/ws/rest/v1/session"`` +Ƭ **ToastType**: ``"error"`` \| ``"info"`` \| ``"info-square"`` \| ``"success"`` \| ``"warning"`` \| ``"warning-alt"`` #### Defined in -[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) +[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) -___ +## API Variables -## Navigation Variables +### UserHasAccess -### ConfigurableLink +• **UserHasAccess**: `React.FC`<[`UserHasAccessProps`](interfaces/UserHasAccessProps.md)\> -• **ConfigurableLink**: `React.FC`<[`ConfigurableLinkProps`](interfaces/ConfigurableLinkProps.md)\> +#### Defined in -A React link component which calls [navigate](API.md#navigate) when clicked +[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) -**`param`** The target path or URL. Supports interpolation. See [navigate](API.md#navigate) +___ -**`param`** Inline elements within the link +### defaultVisitCustomRepresentation -**`param`** Any other valid props for an tag except `href` and `onClick` +• **defaultVisitCustomRepresentation**: `string` #### Defined in -[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) +[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) ___ -## Other Variables - -### ComponentContext +### fhir -• **ComponentContext**: `Context`<[`ComponentConfig`](interfaces/ComponentConfig.md)\> +• **fhir**: `FhirClient` -Available to all components. Provided by `openmrsComponentDecorator`. +The `fhir` object is [an instance of fhir.js](https://github.com/FHIR/fhir.js) +that can be used to call FHIR-compliant OpenMRS APIs. See +[the docs for fhir.js](https://github.com/FHIR/fhir.js) for more info +and example usage. #### Defined in -[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) +[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) ___ -### Extension - -• **Extension**: `React.FC`<[`ExtensionProps`](interfaces/ExtensionProps.md)\> - -Represents the position in the DOM where each extension within -an extension slot is rendered. - -Renders once for each extension attached to that extension slot. +### fhirBaseUrl -Usage of this component *must* have an ancestor ``, -and *must* only be used once within that ``. +• **fhirBaseUrl**: ``"/ws/fhir2/R4"`` #### Defined in -[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) +[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) ___ -### ExtensionSlot +### getStartedVisit -• **ExtensionSlot**: `React.FC`<[`ExtensionSlotProps`](API.md#extensionslotprops)\> +• **getStartedVisit**: `BehaviorSubject`<``null`` \| [`VisitItem`](interfaces/VisitItem.md)\> #### Defined in -[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) +[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) ___ -### UserHasAccess +### sessionEndpoint -• **UserHasAccess**: `React.FC`<[`UserHasAccessProps`](interfaces/UserHasAccessProps.md)\> +• **sessionEndpoint**: ``"/ws/rest/v1/session"`` #### Defined in -[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) +[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) ___ -### backendDependencies +## Config Validation Variables -• **backendDependencies**: `Object` +### validators + +• **validators**: `Object` #### Type declaration | Name | Type | | :------ | :------ | -| `fhir2` | `string` | -| `webservices.rest` | `string` | +| `inRange` | (`min`: `number`, `max`: `number`) => [`Validator`](API.md#validator) | +| `isUrl` | [`Validator`](API.md#validator) | +| `isUrlWithTemplateParameters` | (`allowedTemplateParameters`: `string`[]) => [`Validator`](API.md#validator) | #### Defined in -[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) +[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) ___ -### extensionStore +## Navigation Variables + +### ConfigurableLink + +• **ConfigurableLink**: `React.FC`<[`ConfigurableLinkProps`](interfaces/ConfigurableLinkProps.md)\> + +A React link component which calls [navigate](API.md#navigate) when clicked + +**`param`** The target path or URL. Supports interpolation. See [navigate](API.md#navigate) -• **extensionStore**: `Store`<[`ExtensionInternalStore`](interfaces/ExtensionInternalStore.md)\> +**`param`** Inline elements within the link -**`deprecated`** Use `getExtensionStore`. The structure of this store has also changed. +**`param`** Any other valid props for an tag except `href` and `onClick` #### Defined in -[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) +[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) ___ +## Offline Variables + ### offlineUuidPrefix • **offlineUuidPrefix**: ``"OFFLINE+"`` #### Defined in -[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) +[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) ___ @@ -672,7 +595,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -682,7 +605,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -692,25 +615,54 @@ ___ #### Defined in -[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) +[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) ___ -### validators +## Other Variables -• **validators**: `Object` +### Extension + +• **Extension**: `React.FC`<[`ExtensionProps`](interfaces/ExtensionProps.md)\> + +Represents the position in the DOM where each extension within +an extension slot is rendered. + +Renders once for each extension attached to that extension slot. + +Usage of this component *must* have an ancestor ``, +and *must* only be used once within that ``. + +#### Defined in + +[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) + +___ + +### ExtensionSlot + +• **ExtensionSlot**: `React.FC`<[`ExtensionSlotProps`](API.md#extensionslotprops)\> + +#### Defined in + +[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) + +___ + +### backendDependencies + +• **backendDependencies**: `Object` #### Type declaration | Name | Type | | :------ | :------ | -| `inRange` | (`min`: `number`, `max`: `number`) => [`Validator`](API.md#validator) | -| `isUrl` | [`Validator`](API.md#validator) | -| `isUrlWithTemplateParameters` | (`allowedTemplateParameters`: `string`[]) => [`Validator`](API.md#validator) | +| `fhir2` | `string` | +| `webservices.rest` | `string` | #### Defined in -[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) +[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) ## API Functions @@ -731,7 +683,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -776,7 +728,7 @@ leak and source of bugs. #### Defined in -[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) +[packages/framework/esm-api/src/shared-api-objects/current-user.ts:56](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L56) ▸ **getCurrentUser**(`opts`): `Observable`<[`UnauthenticatedUser`](interfaces/UnauthenticatedUser.md)\> @@ -792,7 +744,7 @@ leak and source of bugs. #### Defined in -[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) +[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) ▸ **getCurrentUser**(`opts`): `Observable`<[`LoggedInUser`](interfaces/LoggedInUser.md)\> @@ -808,7 +760,7 @@ leak and source of bugs. #### Defined in -[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) +[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) ___ @@ -822,7 +774,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -836,7 +788,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -850,7 +802,7 @@ ___ #### Defined in -[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) +[packages/framework/esm-api/src/shared-api-objects/current-user.ts:140](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L140) ___ @@ -864,7 +816,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -886,7 +838,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:24](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L24) +[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) ___ @@ -894,6 +846,15 @@ ___ ▸ **makeUrl**(`path`): `string` +Append `path` to the OpenMRS SPA base. + +#### Example + +```ts +makeUrl('/foo/bar'); +// => '/openmrs/foo/bar' +``` + #### Parameters | Name | Type | @@ -906,7 +867,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -973,7 +934,7 @@ free up memory and network resources and to prevent race conditions. #### Defined in -[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) +[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) ___ @@ -1024,7 +985,7 @@ To cancel the network request, simply call `subscription.unsubscribe();` #### Defined in -[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) +[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) ___ @@ -1050,7 +1011,7 @@ refetchCurrentUser() #### Defined in -[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) +[packages/framework/esm-api/src/shared-api-objects/current-user.ts:113](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L113) ___ @@ -1071,7 +1032,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:49](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L49) +[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) ___ @@ -1092,7 +1053,7 @@ ___ #### Defined in -[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) +[packages/framework/esm-api/src/shared-api-objects/current-user.ts:152](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L152) ___ @@ -1112,7 +1073,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -1132,7 +1093,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -1154,7 +1115,132 @@ ___ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:63](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L63) +[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) + +___ + +### useCurrentPatient + +▸ **useCurrentPatient**(`patientUuid?`): [`boolean`, `NullablePatient`, [`PatientUuid`](API.md#patientuuid), `Error` \| ``null``] + +This React hook returns the current patient, as specified by the current route. It returns +all the information needed to render a loading state, error state, and normal/success state. + +**`deprecated`** Use [usePatient](API.md#usepatient) instead. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `patientUuid` | [`PatientUuid`](API.md#patientuuid) | + +#### Returns + +[`boolean`, `NullablePatient`, [`PatientUuid`](API.md#patientuuid), `Error` \| ``null``] + +#### Defined in + +[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) + +___ + +### useLocations + +▸ **useLocations**(): [`Location`](interfaces/Location.md)[] + +#### Returns + +[`Location`](interfaces/Location.md)[] + +#### Defined in + +[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) + +___ + +### usePatient + +▸ **usePatient**(`patientUuid?`): `Object` + +This React hook returns a patient object. If the `patientUuid` is provided +as a parameter, then the patient for that UUID is returned. If the parameter +is not provided, the patient UUID is obtained from the current route, and +a route listener is set up to update the patient whenever the route changes. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `patientUuid?` | `string` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `error` | ``null`` \| `Error` | +| `isLoading` | `boolean` | +| `patient` | [`NullablePatient`](API.md#nullablepatient) | +| `patientUuid` | ``null`` \| `string` | + +#### Defined in + +[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) + +___ + +### useSessionUser + +▸ **useSessionUser**(): ``null`` \| [`SessionUser`](interfaces/SessionUser.md) + +#### Returns + +``null`` \| [`SessionUser`](interfaces/SessionUser.md) + +#### Defined in + +[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) + +___ + +### useVisit + +▸ **useVisit**(`patientUuid`): `VisitReturnType` + +This React hook returns a visit object. If the `patientUuid` is provided +as a parameter, then the currentVisit, error and mutate function +for that patient visit is returned. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `patientUuid` | `string` | Unique patient identifier `string` | + +#### Returns + +`VisitReturnType` + +Object {`error` `isValidating`, `currentVisit`, `mutate`} + +#### Defined in + +[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) + +___ + +### useVisitTypes + +▸ **useVisitTypes**(): [`VisitType`](interfaces/VisitType.md)[] + +#### Returns + +[`VisitType`](interfaces/VisitType.md)[] + +#### Defined in + +[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) ___ @@ -1175,7 +1261,7 @@ ___ #### Defined in -[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) +[packages/framework/esm-api/src/shared-api-objects/current-user.ts:127](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L127) ___ @@ -1198,7 +1284,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -1212,7 +1298,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -1232,7 +1318,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -1252,7 +1338,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -1272,21 +1358,255 @@ ___ #### Defined in -[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) +[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) ___ -## Date and time Functions +## Config Functions -### formatDate +### defineConfigSchema -▸ **formatDate**(`date`, `options?`): `string` +▸ **defineConfigSchema**(`moduleName`, `schema`): `void` -Formats the input date according to the current locale and the -given options. +This defines a configuration schema for a module. The schema tells the +configuration system how the module can be configured. It specifies +what makes configuration valid or invalid. -Default options: - - mode: "standard", +See [Configuration System](http://o3-dev.docs.openmrs.org/#/main/config) +for more information about defining a config schema. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `moduleName` | `string` | Name of the module the schema is being defined for. Generally should be the one in which the `defineConfigSchema` call takes place. | +| `schema` | [`ConfigSchema`](interfaces/ConfigSchema.md) | The config schema for the module | + +#### Returns + +`void` + +#### Defined in + +[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) + +___ + +### defineExtensionConfigSchema + +▸ **defineExtensionConfigSchema**(`extensionName`, `schema`): `void` + +This defines a configuration schema for an extension. When a schema is defined +for an extension, that extension will receive the configuration corresponding +to that schema, rather than the configuration corresponding to the module +in which it is defined. + +The schema tells the configuration system how the module can be configured. +It specifies what makes configuration valid or invalid. + +See [Configuration System](http://o3-dev.docs.openmrs.org/#/main/config) +for more information about defining a config schema. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `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`. | +| `schema` | [`ConfigSchema`](interfaces/ConfigSchema.md) | The config schema for the extension | + +#### Returns + +`void` + +#### Defined in + +[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) + +___ + +### getConfig + +▸ **getConfig**(`moduleName`): `Promise`<[`Config`](interfaces/Config.md)\> + +A promise-based way to access the config as soon as it is fully loaded. +If it is already loaded, resolves the config in its present state. + +In general you should use the Unistore-based API provided by +`getConfigStore`, which allows creating a subscription so that you always +have the latest config. If using React, just use `useConfig`. + +This is a useful function if you need to get the config in the course +of the execution of a function. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `moduleName` | `string` | The name of the module for which to look up the config | + +#### Returns + +`Promise`<[`Config`](interfaces/Config.md)\> + +#### Defined in + +[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) + +___ + +### provide + +▸ **provide**(`config`, `sourceName?`): `void` + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `config` | [`Config`](interfaces/Config.md) | `undefined` | +| `sourceName` | `string` | `"provided"` | + +#### Returns + +`void` + +#### Defined in + +[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) + +___ + +### useConfig + +▸ **useConfig**(): `Object` + +Use this React Hook to obtain your module's configuration. + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `constructor` | `Function` | The initial value of Object.prototype.constructor is the standard built-in Object constructor. | +| `hasOwnProperty` | (`v`: `PropertyKey`) => `boolean` | Determines whether an object has a property with the specified name. | +| `isPrototypeOf` | (`v`: `Object`) => `boolean` | Determines whether an object exists in another object's prototype chain. | +| `propertyIsEnumerable` | (`v`: `PropertyKey`) => `boolean` | Determines whether a specified property is enumerable. | +| `toLocaleString` | () => `string` | Returns a date converted to a string using the current locale. | +| `toString` | () => `string` | Returns a string representation of an object. | +| `valueOf` | () => `Object` | Returns the primitive value of the specified object. | + +#### Defined in + +[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) + +___ + +## Config Validation Functions + +### inRange + +▸ `Const` **inRange**(`min`, `max`): [`Validator`](API.md#validator) + +Verifies that the value is between the provided minimum and maximum + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `min` | `number` | Minimum acceptable value | +| `max` | `number` | Maximum acceptable value | + +#### Returns + +[`Validator`](API.md#validator) + +#### Defined in + +[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) + +___ + +### isUrl + +▸ `Const` **isUrl**(`value`): `string` \| `void` + +Verifies that a string contains only the default URL template parameters. + +**`category`** Navigation + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value` | `any` | + +#### Returns + +`string` \| `void` + +#### Defined in + +[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) + +___ + +### isUrlWithTemplateParameters + +▸ `Const` **isUrlWithTemplateParameters**(`allowedTemplateParameters`): [`Validator`](API.md#validator) + +Verifies that a string contains only the default URL template +parameters, plus any specified in `allowedTemplateParameters`. + +**`category`** Navigation + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `allowedTemplateParameters` | `string`[] | To be added to `openmrsBase` and `openmrsSpaBase` | + +#### Returns + +[`Validator`](API.md#validator) + +#### Defined in + +[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) + +___ + +### validator + +▸ **validator**(`validationFunction`, `message`): [`Validator`](API.md#validator) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `validationFunction` | [`ValidatorFunction`](API.md#validatorfunction) | +| `message` | `string` | + +#### Returns + +[`Validator`](API.md#validator) + +#### Defined in + +[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) + +___ + +## Date and Time Functions + +### formatDate + +▸ **formatDate**(`date`, `options?`): `string` + +Formats the input date according to the current locale and the +given options. + +Default options: + - mode: "standard", - time: "for today", - day: true, - year: true @@ -1593,132 +1913,124 @@ Formats the input as a date string using the format "DD-MMM". ___ -## Navigation Functions +## Error Handling Functions -### interpolateString +### createErrorHandler -▸ **interpolateString**(`template`, `params`): `string` +▸ **createErrorHandler**(): (`incomingErr`: `any`) => `void` -Interpolates values of `params` into the `template` string. +#### Returns -Useful for additional template parameters in URLs. +`fn` -Example usage: -```js -navigate({ - to: interpolateString( - config.links.patientChart, - { patientUuid: patient.uuid } - ) -}); -``` +▸ (`incomingErr`): `void` -#### Parameters +##### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `template` | `string` | With optional params wrapped in `${ }` | -| `params` | `object` | Values to interpolate into the string template | +| Name | Type | +| :------ | :------ | +| `incomingErr` | `any` | -#### Returns +##### Returns -`string` +`void` #### Defined in -[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) +[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) ___ -### interpolateUrl - -▸ **interpolateUrl**(`template`): `string` - -Interpolates a string with openmrsBase and openmrsSpaBase. +### reportError -Useful for accepting `${openmrsBase}` or `${openmrsSpaBase}` template -parameters in configurable URLs. +▸ **reportError**(`err`): `void` #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `template` | `string` | A string to interpolate | +| Name | Type | +| :------ | :------ | +| `err` | `any` | #### Returns -`string` +`void` #### Defined in -[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) +[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) ___ -### isUrl +## Extension Functions -▸ `Const` **isUrl**(`value`): `string` \| `void` +### attach -Verifies that a string contains only the default URL template parameters. +▸ **attach**(`slotName`, `extensionId`): `void` + +Attach an extension to an extension slot. + +This will cause the extension to be rendered into the specified +extension slot, unless it is removed by configuration. Using +`attach` is an alternative to specifying the `slot` or `slots` +in the extension declaration. + +It is particularly useful when creating a slot into which +you want to render an existing extension. This enables you +to do so without modifying the extension's declaration, which +may be impractical or inappropriate, for example if you are +writing a module for a specific implementation. #### Parameters -| Name | Type | -| :------ | :------ | -| `value` | `any` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `slotName` | `string` | a name uniquely identifying the slot | +| `extensionId` | `string` | an extension name, with an optional #-suffix to distinguish it from other instances of the same extension attached to the same slot. | #### Returns -`string` \| `void` +`void` #### Defined in -[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) +[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) ___ -### isUrlWithTemplateParameters +### detach -▸ `Const` **isUrlWithTemplateParameters**(`allowedTemplateParameters`): [`Validator`](API.md#validator) +▸ **detach**(`extensionSlotName`, `extensionId`): `void` -Verifies that a string contains only the default URL template -parameters, plus any specified in `allowedTemplateParameters`. +Avoid using this. Extension attachments should be considered declarative. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `allowedTemplateParameters` | `string`[] | To be added to `openmrsBase` and `openmrsSpaBase` | +| Name | Type | +| :------ | :------ | +| `extensionSlotName` | `string` | +| `extensionId` | `string` | #### Returns -[`Validator`](API.md#validator) +`void` #### Defined in -[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) +[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) ___ -### navigate - -▸ **navigate**(`to`): `void` +### detachAll -Calls `location.assign` for non-SPA paths and [navigateToUrl](https://single-spa.js.org/docs/api/#navigatetourl) for SPA paths +▸ **detachAll**(`extensionSlotName`): `void` -Example usage: -```js -const config = getConfig(); -const submitHandler = () => { - navigate({ to: config.links.submitSuccess }); -}; -``` +Avoid using this. Extension attachments should be considered declarative. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `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. | +| Name | Type | +| :------ | :------ | +| `extensionSlotName` | `string` | #### Returns @@ -1726,448 +2038,491 @@ const submitHandler = () => { #### Defined in -[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) +[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) ___ -## Other Functions +### getAssignedExtensions + +▸ **getAssignedExtensions**(`slotName`): [`AssignedExtension`](interfaces/AssignedExtension.md)[] -### activateOfflineCapability +#### Parameters -▸ **activateOfflineCapability**(): `Promise`<`void`\> +| Name | Type | +| :------ | :------ | +| `slotName` | `string` | #### Returns -`Promise`<`void`\> +[`AssignedExtension`](interfaces/AssignedExtension.md)[] #### Defined in -[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) +[packages/framework/esm-extensions/src/extensions.ts:325](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L325) ___ -### age +### getConnectedExtensions -▸ **age**(`dateString`): `string` +▸ **getConnectedExtensions**(`assignedExtensions`, `online?`): [`ConnectedExtension`](interfaces/ConnectedExtension.md)[] -Gets a human readable age represention of the provided date string. +Filters a list of extensions according to whether they support the +current connectivity status. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `dateString` | `string` | The stringified date. | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `assignedExtensions` | [`AssignedExtension`](interfaces/AssignedExtension.md)[] | `undefined` | The list of extensions to filter. | +| `online` | ``null`` \| `boolean` | `null` | Whether the app is currently online. If `null`, uses `navigator.onLine`. | #### Returns -`string` +[`ConnectedExtension`](interfaces/ConnectedExtension.md)[] -A human-readable string version of the age. +A list of extensions that should be rendered #### Defined in -[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) +[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) ___ -### attach - -▸ **attach**(`slotName`, `extensionId`): `void` +### getExtensionNameFromId -Attach an extension to an extension slot. +▸ **getExtensionNameFromId**(`extensionId`): `string` -This will cause the extension to be rendered into the specified -extension slot, unless it is removed by configuration. Using -`attach` is an alternative to specifying the `slot` or `slots` -in the extension declaration. +Given an extension ID, which is a string uniquely identifying +an instance of an extension within an extension slot, this +returns the extension name. -It is particularly useful when creating a slot into which -you want to render an existing extension. This enables you -to do so without modifying the extension's declaration, which -may be impractical or inappropriate, for example if you are -writing a module for a specific implementation. +**`example`** +```js +getExtensionNameFromId("foo#bar") + --> "foo" +getExtensionNameFromId("baz") + --> "baz" +``` #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `slotName` | `string` | a name uniquely identifying the slot | -| `extensionId` | `string` | an extension name, with an optional #-suffix to distinguish it from other instances of the same extension attached to the same slot. | +| Name | Type | +| :------ | :------ | +| `extensionId` | `string` | #### Returns -`void` +`string` #### Defined in -[packages/framework/esm-extensions/src/extensions.ts:171](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L171) +[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) ___ -### beginEditSynchronizationItem - -▸ **beginEditSynchronizationItem**(`id`): `Promise`<`void`\> - -Triggers an edit flow for the given synchronization item. -If this is not possible, throws an error. +### getExtensionStore -#### Parameters +▸ `Const` **getExtensionStore**(): `Store`<[`ExtensionStore`](interfaces/ExtensionStore.md)\> -| Name | Type | Description | -| :------ | :------ | :------ | -| `id` | `number` | The ID of the synchronization item to be edited. | +This returns a [store](https://github.com/developit/unistore#store) +that modules can use to get information about the state of the +extension system. #### Returns -`Promise`<`void`\> +`Store`<[`ExtensionStore`](interfaces/ExtensionStore.md)\> #### Defined in -[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) +[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) ___ -### canBeginEditSynchronizationItemsOfType +### renderExtension -▸ **canBeginEditSynchronizationItemsOfType**(`type`): `boolean` +▸ **renderExtension**(`domElement`, `extensionSlotName`, `extensionSlotModuleName`, `extensionId`, `renderFunction?`, `additionalProps?`): [`CancelLoading`](interfaces/CancelLoading.md) -Returns whether editing synchronization items of the given type is supported by the currently -registered synchronization handlers. +Mounts into a DOM node (representing an extension slot) +a lazy-loaded component from *any* frontend module +that registered an extension component for this slot. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `type` | `string` | The identifying type of the synchronization item which should be edited. | +| Name | Type | +| :------ | :------ | +| `domElement` | `HTMLElement` | +| `extensionSlotName` | `string` | +| `extensionSlotModuleName` | `string` | +| `extensionId` | `string` | +| `renderFunction` | (`lifecycle`: [`Lifecycle`](interfaces/Lifecycle.md)) => [`Lifecycle`](interfaces/Lifecycle.md) | +| `additionalProps` | `Record`<`string`, `any`\> | #### Returns -`boolean` +[`CancelLoading`](interfaces/CancelLoading.md) #### Defined in -[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) +[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) ___ -### checkStatus +### useAssignedExtensionIds + +▸ **useAssignedExtensionIds**(`slotName`): `string`[] + +Gets the assigned extension ids for a given extension slot name. +Does not consider if offline or online. -▸ **checkStatus**(`online?`, `offline?`): `boolean` +**`deprecated`** Use `useAssignedExtensions` #### Parameters -| Name | Type | Default value | +| Name | Type | Description | | :------ | :------ | :------ | -| `online` | `boolean` \| `object` | `true` | -| `offline` | `boolean` \| `object` | `false` | +| `slotName` | `string` | The name of the slot to get the assigned IDs for. | #### Returns -`boolean` +`string`[] #### Defined in -[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) +[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) ___ -### checkStatusFor +### useAssignedExtensions + +▸ **useAssignedExtensions**(`slotName`): [`AssignedExtension`](interfaces/AssignedExtension.md)[] -▸ **checkStatusFor**(`status`, `online?`, `offline?`): `boolean` +Gets the assigned extensions for a given extension slot name. +Does not consider if offline or online. #### Parameters -| Name | Type | Default value | +| Name | Type | Description | | :------ | :------ | :------ | -| `status` | `boolean` | `undefined` | -| `online` | `boolean` \| `object` | `true` | -| `offline` | `boolean` \| `object` | `false` | +| `slotName` | `string` | The name of the slot to get the assigned extensions for. | #### Returns -`boolean` +[`AssignedExtension`](interfaces/AssignedExtension.md)[] #### Defined in -[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) +[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) ___ -### createErrorHandler - -▸ **createErrorHandler**(): (`incomingErr`: `any`) => `void` - -#### Returns +### useConnectedExtensions -`fn` +▸ **useConnectedExtensions**(`slotName`): [`ConnectedExtension`](interfaces/ConnectedExtension.md)[] -▸ (`incomingErr`): `void` +Gets the assigned extension for a given extension slot name. +Considers if offline or online. -##### Parameters +#### Parameters -| Name | Type | -| :------ | :------ | -| `incomingErr` | `any` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `slotName` | `string` | The name of the slot to get the assigned extensions for. | -##### Returns +#### Returns -`void` +[`ConnectedExtension`](interfaces/ConnectedExtension.md)[] #### Defined in -[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) +[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) ___ -### createGlobalStore +### useExtensionSlotMeta -▸ **createGlobalStore**<`TState`\>(`name`, `initialState`): `Store`<`TState`\> +▸ **useExtensionSlotMeta**<`T`\>(`extensionSlotName`): `Object` -Creates a Unistore [store](https://github.com/developit/unistore#store). +Extract meta data from all extension for a given extension slot. #### Type parameters -| Name | -| :------ | -| `TState` | +| Name | Type | +| :------ | :------ | +| `T` | [`ExtensionMeta`](interfaces/ExtensionMeta.md) | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `name` | `string` | A name by which the store can be looked up later. Must be unique across the entire application. | -| `initialState` | `TState` | An object which will be the initial state of the store. | +| Name | Type | +| :------ | :------ | +| `extensionSlotName` | `string` | #### Returns -`Store`<`TState`\> - -The newly created store. +`Object` #### Defined in -[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) +[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) ___ -### createUseStore +### useExtensionStore -▸ **createUseStore**<`T`\>(`store`): () => `T`(`actions`: [`Actions`](API.md#actions)) => `T` & [`BoundActions`](API.md#boundactions)(`actions?`: [`Actions`](API.md#actions)) => `T` & [`BoundActions`](API.md#boundactions) +▸ `Const` **useExtensionStore**(): `T` -Avoid this; generally prefer to have clients use `useStore(yourStore)` +#### Returns -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `store` | `Store`<`T`\> | - -#### Returns - -`fn` - -▸ (): `T` +`T` -##### Returns +#### Defined in -`T` +[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) -▸ (`actions`): `T` & [`BoundActions`](API.md#boundactions) +▸ `Const` **useExtensionStore**(`actions`): `T` & [`BoundActions`](API.md#boundactions) -##### Parameters +#### Parameters | Name | Type | | :------ | :------ | | `actions` | [`Actions`](API.md#actions) | -##### Returns +#### Returns `T` & [`BoundActions`](API.md#boundactions) -▸ (`actions?`): `T` & [`BoundActions`](API.md#boundactions) +#### Defined in -##### Parameters +[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) + +▸ `Const` **useExtensionStore**(`actions?`): `T` & [`BoundActions`](API.md#boundactions) + +#### Parameters | Name | Type | | :------ | :------ | | `actions?` | [`Actions`](API.md#actions) | -##### Returns +#### Returns `T` & [`BoundActions`](API.md#boundactions) #### Defined in -[packages/framework/esm-react-utils/src/createUseStore.ts:22](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/createUseStore.ts#L22) +[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) ___ -### daysIntoYear +## Framework Functions -▸ **daysIntoYear**(`date`): `number` +### getAsyncExtensionLifecycle -Gets the number of days in the year of the given date. +▸ `Const` **getAsyncExtensionLifecycle**<`T`\>(`lazy`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\> + +**`deprecated`** Use getAsyncLifecycle instead. + +#### Type parameters + +| Name | +| :------ | +| `T` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `date` | `Date` | The date to compute the days within the year. | +| Name | Type | +| :------ | :------ | +| `lazy` | () => `Promise`<{ `default`: `ComponentType`<`T`\> }\> | +| `options` | `ComponentDecoratorOptions` | #### Returns -`number` +`fn` -The number of days. +▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\> + +##### Returns + +`Promise`<`ReactAppOrParcel`<`any`\>\> #### Defined in -[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) +[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) ___ -### defineConfigSchema +### getAsyncLifecycle -▸ **defineConfigSchema**(`moduleName`, `schema`): `void` +▸ **getAsyncLifecycle**<`T`\>(`lazy`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\> -This defines a configuration schema for a module. The schema tells the -configuration system how the module can be configured. It specifies -what makes configuration valid or invalid. +#### Type parameters -See [Configuration System](http://o3-dev.docs.openmrs.org/#/main/config) -for more information about defining a config schema. +| Name | +| :------ | +| `T` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `moduleName` | `string` | Name of the module the schema is being defined for. Generally should be the one in which the `defineConfigSchema` call takes place. | -| `schema` | [`ConfigSchema`](interfaces/ConfigSchema.md) | The config schema for the module | +| Name | Type | +| :------ | :------ | +| `lazy` | () => `Promise`<{ `default`: `ComponentType`<`T`\> }\> | +| `options` | `ComponentDecoratorOptions` | #### Returns -`void` +`fn` + +▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\> + +##### Returns + +`Promise`<`ReactAppOrParcel`<`any`\>\> #### Defined in -[packages/framework/esm-config/src/module-config/module-config.ts:192](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/module-config.ts#L192) +[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) ___ -### defineExtensionConfigSchema - -▸ **defineExtensionConfigSchema**(`extensionName`, `schema`): `void` +### getLifecycle -This defines a configuration schema for an extension. When a schema is defined -for an extension, that extension will receive the configuration corresponding -to that schema, rather than the configuration corresponding to the module -in which it is defined. +▸ **getLifecycle**<`T`\>(`Component`, `options`): `ReactAppOrParcel`<`any`\> -The schema tells the configuration system how the module can be configured. -It specifies what makes configuration valid or invalid. +#### Type parameters -See [Configuration System](http://o3-dev.docs.openmrs.org/#/main/config) -for more information about defining a config schema. +| Name | +| :------ | +| `T` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `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`. | -| `schema` | [`ConfigSchema`](interfaces/ConfigSchema.md) | The config schema for the extension | +| Name | Type | +| :------ | :------ | +| `Component` | `ComponentType`<`T`\> | +| `options` | `ComponentDecoratorOptions` | #### Returns -`void` +`ReactAppOrParcel`<`any`\> #### Defined in -[packages/framework/esm-config/src/module-config/module-config.ts:217](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/module-config.ts#L217) +[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) ___ -### deleteSynchronizationItem +### getSyncLifecycle -▸ **deleteSynchronizationItem**(`id`): `Promise`<`void`\> +▸ **getSyncLifecycle**<`T`\>(`Component`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\> -Deletes a queued up sync item with the given ID. +#### Type parameters + +| Name | +| :------ | +| `T` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `id` | `number` | The ID of the synchronization item to be deleted. | +| Name | Type | +| :------ | :------ | +| `Component` | `ComponentType`<`T`\> | +| `options` | `ComponentDecoratorOptions` | #### Returns -`Promise`<`void`\> +`fn` + +▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\> + +##### Returns + +`Promise`<`ReactAppOrParcel`<`any`\>\> #### Defined in -[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) +[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) ___ -### detach +## Navigation Functions -▸ **detach**(`extensionSlotName`, `extensionId`): `void` +### interpolateString -Avoid using this. Extension attachments should be considered declarative. +▸ **interpolateString**(`template`, `params`): `string` + +Interpolates values of `params` into the `template` string. + +Useful for additional template parameters in URLs. + +Example usage: +```js +navigate({ + to: interpolateString( + config.links.patientChart, + { patientUuid: patient.uuid } + ) +}); +``` #### Parameters -| Name | Type | -| :------ | :------ | -| `extensionSlotName` | `string` | -| `extensionId` | `string` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `template` | `string` | With optional params wrapped in `${ }` | +| `params` | `object` | Values to interpolate into the string template | #### Returns -`void` +`string` #### Defined in -[packages/framework/esm-extensions/src/extensions.ts:202](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L202) +[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) ___ -### detachAll +### interpolateUrl -▸ **detachAll**(`extensionSlotName`): `void` +▸ **interpolateUrl**(`template`): `string` -Avoid using this. Extension attachments should be considered declarative. +Interpolates a string with openmrsBase and openmrsSpaBase. + +Useful for accepting `${openmrsBase}` or `${openmrsSpaBase}` template +parameters in configurable URLs. #### Parameters -| Name | Type | -| :------ | :------ | -| `extensionSlotName` | `string` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `template` | `string` | A string to interpolate | #### Returns -`void` +`string` #### Defined in -[packages/framework/esm-extensions/src/extensions.ts:226](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L226) +[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) ___ -### dispatchConnectivityChanged +### navigate + +▸ **navigate**(`to`): `void` + +Calls `location.assign` for non-SPA paths and [navigateToUrl](https://single-spa.js.org/docs/api/#navigatetourl) for SPA paths -▸ **dispatchConnectivityChanged**(`online`): `void` +Example usage: +```js +const config = getConfig(); +const submitHandler = () => { + navigate({ to: config.links.submitSuccess }); +}; +``` #### Parameters -| Name | Type | -| :------ | :------ | -| `online` | `boolean` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `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. | #### Returns @@ -2175,67 +2530,77 @@ ___ #### Defined in -[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) +[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) ___ -### dispatchNetworkRequestFailed +## Offline Functions + +### beginEditSynchronizationItem + +▸ **beginEditSynchronizationItem**(`id`): `Promise`<`void`\> -▸ **dispatchNetworkRequestFailed**(`data`): `void` +Triggers an edit flow for the given synchronization item. +If this is not possible, throws an error. #### Parameters -| Name | Type | -| :------ | :------ | -| `data` | [`NetworkRequestFailedEvent`](interfaces/NetworkRequestFailedEvent.md) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `id` | `number` | The ID of the synchronization item to be edited. | #### Returns -`void` +`Promise`<`void`\> #### Defined in -[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) +[packages/framework/esm-offline/src/sync.ts:355](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L355) ___ -### dispatchNotificationShown +### canBeginEditSynchronizationItemsOfType + +▸ **canBeginEditSynchronizationItemsOfType**(`type`): `boolean` -▸ **dispatchNotificationShown**(`data`): `void` +Returns whether editing synchronization items of the given type is supported by the currently +registered synchronization handlers. #### Parameters -| Name | Type | -| :------ | :------ | -| `data` | [`ShowNotificationEvent`](interfaces/ShowNotificationEvent.md) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `type` | `string` | The identifying type of the synchronization item which should be edited. | #### Returns -`void` +`boolean` #### Defined in -[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) +[packages/framework/esm-offline/src/sync.ts:345](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L345) ___ -### dispatchPrecacheStaticDependencies +### deleteSynchronizationItem + +▸ **deleteSynchronizationItem**(`id`): `Promise`<`void`\> -▸ **dispatchPrecacheStaticDependencies**(`data?`): `void` +Deletes a queued up sync item with the given ID. #### Parameters -| Name | Type | -| :------ | :------ | -| `data` | [`PrecacheStaticDependenciesEvent`](interfaces/PrecacheStaticDependenciesEvent.md) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `id` | `number` | The ID of the synchronization item to be deleted. | #### Returns -`void` +`Promise`<`void`\> #### Defined in -[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) +[packages/framework/esm-offline/src/sync.ts:375](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L375) ___ @@ -2251,51 +2616,71 @@ Generates a UUID-like string which is used for uniquely identifying objects whil #### Defined in -[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) +[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) ___ -### getAppState +### getCurrentOfflineMode -▸ **getAppState**(): `Store`<[`AppState`](interfaces/AppState.md)\> +▸ **getCurrentOfflineMode**(): [`OfflineModeResult`](interfaces/OfflineModeResult.md) #### Returns -`Store`<[`AppState`](interfaces/AppState.md)\> - -The [store](https://github.com/developit/unistore#store) named `app`. +[`OfflineModeResult`](interfaces/OfflineModeResult.md) #### Defined in -[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) +[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) ___ -### getAssignedExtensions +### getOfflinePatientDataStore -▸ **getAssignedExtensions**(`slotName`): [`AssignedExtension`](interfaces/AssignedExtension.md)[] +▸ **getOfflinePatientDataStore**(): `Store`<[`OfflinePatientDataSyncStore`](interfaces/OfflinePatientDataSyncStore.md)\> -#### Parameters +#### Returns + +`Store`<[`OfflinePatientDataSyncStore`](interfaces/OfflinePatientDataSyncStore.md)\> + +#### Defined in + +[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) + +___ + +### getSynchronizationItem + +▸ **getSynchronizationItem**<`T`\>(`id`): `Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\> \| `undefined`\> + +Returns a queued sync item with the given ID or `undefined` if no such item exists. + +#### Type parameters | Name | Type | | :------ | :------ | -| `slotName` | `string` | +| `T` | `any` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `id` | `number` | The ID of the requested sync item. | #### Returns -[`AssignedExtension`](interfaces/AssignedExtension.md)[] +`Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\> \| `undefined`\> #### Defined in -[packages/framework/esm-extensions/src/extensions.ts:324](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L324) +[packages/framework/esm-offline/src/sync.ts:334](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L334) ___ -### getAsyncExtensionLifecycle +### getSynchronizationItems -▸ `Const` **getAsyncExtensionLifecycle**<`T`\>(`lazy`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\> +▸ **getSynchronizationItems**<`T`\>(`type`): `Promise`<`T`[]\> -**`deprecated`** Use getAsyncLifecycle instead. +Returns all currently queued up sync items of the currently signed in user. #### Type parameters @@ -2305,277 +2690,321 @@ ___ #### Parameters +| Name | Type | Description | +| :------ | :------ | :------ | +| `type` | `string` | The identifying type of the synchronization items to be returned. | + +#### Returns + +`Promise`<`T`[]\> + +#### Defined in + +[packages/framework/esm-offline/src/sync.ts:325](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L325) + +___ + +### isOfflineUuid + +▸ **isOfflineUuid**(`uuid`): `boolean` + +Checks whether the given string has the format of an offline UUID generated by [generateOfflineUuid](API.md#generateofflineuuid) + +#### Parameters + | Name | Type | | :------ | :------ | -| `lazy` | () => `Promise`<{ `default`: `ComponentType`<`T`\> }\> | -| `options` | [`ComponentDecoratorOptions`](interfaces/ComponentDecoratorOptions.md) | +| `uuid` | `string` | #### Returns -`fn` +`boolean` -▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\> +#### Defined in -##### Returns +[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) -`Promise`<`ReactAppOrParcel`<`any`\>\> +___ + +### loadPersistedPatientDataSyncState + +▸ **loadPersistedPatientDataSyncState**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> #### Defined in -[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) +[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) ___ -### getAsyncLifecycle - -▸ **getAsyncLifecycle**<`T`\>(`lazy`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\> +### messageOmrsServiceWorker -#### Type parameters +▸ **messageOmrsServiceWorker**(`message`): `Promise`<[`MessageServiceWorkerResult`](interfaces/MessageServiceWorkerResult.md)<`any`\>\> -| Name | -| :------ | -| `T` | +Sends the specified message to the application's service worker. #### Parameters -| Name | Type | -| :------ | :------ | -| `lazy` | () => `Promise`<{ `default`: `ComponentType`<`T`\> }\> | -| `options` | [`ComponentDecoratorOptions`](interfaces/ComponentDecoratorOptions.md) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `message` | [`KnownOmrsServiceWorkerMessages`](API.md#knownomrsserviceworkermessages) | The message to be sent. | #### Returns -`fn` - -▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\> - -##### Returns +`Promise`<[`MessageServiceWorkerResult`](interfaces/MessageServiceWorkerResult.md)<`any`\>\> -`Promise`<`ReactAppOrParcel`<`any`\>\> +A promise which completes when the message has been successfully processed by the Service Worker. #### Defined in -[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) +[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) ___ -### getConfig +### queueSynchronizationItem -▸ **getConfig**(`moduleName`): `Promise`<[`Config`](interfaces/Config.md)\> +▸ **queueSynchronizationItem**<`T`\>(`type`, `content`, `descriptor?`): `Promise`<`number`\> -A promise-based way to access the config as soon as it is fully loaded. -If it is already loaded, resolves the config in its present state. +Enqueues a new item in the sync queue and associates the item with the currently signed in user. -In general you should use the Unistore-based API provided by -`getConfigStore`, which allows creating a subscription so that you always -have the latest config. If using React, just use `useConfig`. +#### Type parameters -This is a useful function if you need to get the config in the course -of the execution of a function. +| Name | +| :------ | +| `T` | #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `moduleName` | `string` | The name of the module for which to look up the config | +| `type` | `string` | The identifying type of the synchronization item. | +| `content` | `T` | The actual data to be synchronized. | +| `descriptor?` | [`QueueItemDescriptor`](interfaces/QueueItemDescriptor.md) | An optional descriptor providing additional metadata about the sync item. | #### Returns -`Promise`<[`Config`](interfaces/Config.md)\> +`Promise`<`number`\> #### Defined in -[packages/framework/esm-config/src/module-config/module-config.ts:253](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/module-config.ts#L253) +[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) ___ -### getConnectedExtensions +### registerOfflinePatientHandler -▸ **getConnectedExtensions**(`assignedExtensions`, `online?`): [`ConnectedExtension`](interfaces/ConnectedExtension.md)[] +▸ **registerOfflinePatientHandler**(`identifier`, `handler`): `void` -Filters a list of extensions according to whether they support the -current connectivity status. +Attempts to add the specified patient handler registration to the list of offline patient handlers. #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `assignedExtensions` | [`AssignedExtension`](interfaces/AssignedExtension.md)[] | `undefined` | The list of extensions to filter. | -| `online` | ``null`` \| `boolean` | `null` | Whether the app is currently online. If `null`, uses `navigator.onLine`. | +| Name | Type | Description | +| :------ | :------ | :------ | +| `identifier` | `string` | A key which uniquely identifies the registration. | +| `handler` | [`OfflinePatientDataSyncHandler`](interfaces/OfflinePatientDataSyncHandler.md) | The patient handler registration to be registered. | #### Returns -[`ConnectedExtension`](interfaces/ConnectedExtension.md)[] +`void` -A list of extensions that should be rendered +`true` if the registration was successfully made; `false` if another registration with + the same identifier has already been registered before. #### Defined in -[packages/framework/esm-extensions/src/extensions.ts:284](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L284) +[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) ___ -### getCurrentOfflineMode +### setupOfflineSync -▸ **getCurrentOfflineMode**(): [`OfflineModeResult`](interfaces/OfflineModeResult.md) +▸ **setupOfflineSync**<`T`\>(`type`, `dependsOn`, `process`, `options?`): `void` + +Registers a new synchronization handler which is able to synchronize data of a specific type. + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `type` | `string` | The identifying type of the synchronization items which can be handled by this handler. | +| `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. | +| `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). | +| `options` | `SetupOfflineSyncOptions`<`T`\> | Additional options which can optionally be provided when setting up a synchronization callback for a specific synchronization item type. | #### Returns -[`OfflineModeResult`](interfaces/OfflineModeResult.md) +`void` #### Defined in -[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) +[packages/framework/esm-offline/src/sync.ts:390](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L390) ___ -### getCustomProps +### subscribeConnectivity -▸ **getCustomProps**(`online`, `offline`): `object` +▸ **subscribeConnectivity**(`cb`): () => `void` #### Parameters | Name | Type | | :------ | :------ | -| `online` | `undefined` \| `boolean` \| `object` | -| `offline` | `undefined` \| `boolean` \| `object` | +| `cb` | (`ev`: [`ConnectivityChangedEvent`](interfaces/ConnectivityChangedEvent.md)) => `void` | #### Returns -`object` +`fn` -#### Defined in +▸ (): `void` -[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) +##### Returns -___ +`void` -### getExtensionNameFromId +#### Defined in -▸ **getExtensionNameFromId**(`extensionId`): `string` +[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) -Given an extension ID, which is a string uniquely identifying -an instance of an extension within an extension slot, this -returns the extension name. +___ -**`example`** -```js -getExtensionNameFromId("foo#bar") - --> "foo" -getExtensionNameFromId("baz") - --> "baz" -``` +### subscribeConnectivityChanged + +▸ **subscribeConnectivityChanged**(`cb`): () => `void` #### Parameters | Name | Type | | :------ | :------ | -| `extensionId` | `string` | +| `cb` | (`ev`: [`ConnectivityChangedEvent`](interfaces/ConnectivityChangedEvent.md)) => `void` | #### Returns -`string` +`fn` + +▸ (): `void` + +##### Returns + +`void` #### Defined in -[packages/framework/esm-extensions/src/extensions.ts:115](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L115) +[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) ___ -### getExtensionRegistration +### subscribePrecacheStaticDependencies -▸ **getExtensionRegistration**(`extensionId`): [`ExtensionRegistration`](interfaces/ExtensionRegistration.md) \| `undefined` +▸ **subscribePrecacheStaticDependencies**(`cb`): () => `void` #### Parameters | Name | Type | | :------ | :------ | -| `extensionId` | `string` | +| `cb` | (`data`: [`PrecacheStaticDependenciesEvent`](interfaces/PrecacheStaticDependenciesEvent.md)) => `void` | #### Returns -[`ExtensionRegistration`](interfaces/ExtensionRegistration.md) \| `undefined` +`fn` + +▸ (): `void` + +##### Returns + +`void` #### Defined in -[packages/framework/esm-extensions/src/extensions.ts:128](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L128) +[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) ___ -### getExtensionRegistrationFrom +### syncOfflinePatientData + +▸ **syncOfflinePatientData**(`patientUuid`): `Promise`<`void`\> -▸ **getExtensionRegistrationFrom**(`state`, `extensionId`): [`ExtensionRegistration`](interfaces/ExtensionRegistration.md) \| `undefined` +Notifies all registered offline patient handlers that a new patient must be made available offline. #### Parameters | Name | Type | | :------ | :------ | -| `state` | [`ExtensionInternalStore`](interfaces/ExtensionInternalStore.md) | -| `extensionId` | `string` | +| `patientUuid` | `string` | #### Returns -[`ExtensionRegistration`](interfaces/ExtensionRegistration.md) \| `undefined` +`Promise`<`void`\> + +A promise which resolves once all registered handlers have finished synchronizing. #### Defined in -[packages/framework/esm-extensions/src/extensions.ts:120](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L120) +[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) ___ -### getExtensionStore - -▸ `Const` **getExtensionStore**(): `Store`<[`ExtensionStore`](interfaces/ExtensionStore.md)\> +### useConnectivity -This returns a [store](https://github.com/developit/unistore#store) -that modules can use to get information about the state of the -extension system. +▸ **useConnectivity**(): `boolean` #### Returns -`Store`<[`ExtensionStore`](interfaces/ExtensionStore.md)\> +`boolean` #### Defined in -[packages/framework/esm-extensions/src/store.ts:128](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L128) +[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) ___ -### getGlobalStore +## Store Functions -▸ **getGlobalStore**<`TState`\>(`name`, `fallbackState?`): `Store`<`TState`\> +### createGlobalStore -Returns the existing [store](https://github.com/developit/unistore#store) named `name`, -or creates a new store named `name` if none exists. +▸ **createGlobalStore**<`TState`\>(`name`, `initialState`): `Store`<`TState`\> + +Creates a Unistore [store](https://github.com/developit/unistore#store). #### Type parameters -| Name | Type | -| :------ | :------ | -| `TState` | `any` | +| Name | +| :------ | +| `TState` | #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `name` | `string` | The name of the store to look up. | -| `fallbackState?` | `TState` | The initial value of the new store if no store named `name` exists. | +| `name` | `string` | A name by which the store can be looked up later. Must be unique across the entire application. | +| `initialState` | `TState` | An object which will be the initial state of the store. | #### Returns `Store`<`TState`\> -The found or newly created store. +The newly created store. #### Defined in -[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) +[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) ___ -### getLifecycle +### createUseStore -▸ **getLifecycle**<`T`\>(`Component`, `options`): `ReactAppOrParcel`<`any`\> +▸ **createUseStore**<`T`\>(`store`): () => `T`(`actions`: [`Actions`](API.md#actions)) => `T` & [`BoundActions`](API.md#boundactions)(`actions?`: [`Actions`](API.md#actions)) => `T` & [`BoundActions`](API.md#boundactions) + +Avoid this; generally prefer to have clients use `useStore(yourStore)` #### Type parameters @@ -2587,1440 +3016,366 @@ ___ | Name | Type | | :------ | :------ | -| `Component` | `ComponentType`<`T`\> | -| `options` | [`ComponentDecoratorOptions`](interfaces/ComponentDecoratorOptions.md) | +| `store` | `Store`<`T`\> | #### Returns -`ReactAppOrParcel`<`any`\> +`fn` -#### Defined in +▸ (): `T` -[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) +##### Returns -___ - -### getOfflinePatientDataStore - -▸ **getOfflinePatientDataStore**(): `Store`<[`OfflinePatientDataSyncStore`](interfaces/OfflinePatientDataSyncStore.md)\> - -#### Returns - -`Store`<[`OfflinePatientDataSyncStore`](interfaces/OfflinePatientDataSyncStore.md)\> - -#### Defined in - -[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) - -___ - -### getOfflineSynchronizationStore - -▸ **getOfflineSynchronizationStore**(): `Store`<[`OfflineSynchronizationStore`](interfaces/OfflineSynchronizationStore.md)\> - -#### Returns - -`Store`<[`OfflineSynchronizationStore`](interfaces/OfflineSynchronizationStore.md)\> +`T` -#### Defined in +▸ (`actions`): `T` & [`BoundActions`](API.md#boundactions) -[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) +##### Parameters -___ +| Name | Type | +| :------ | :------ | +| `actions` | [`Actions`](API.md#actions) | -### getOmrsServiceWorker +##### Returns -▸ **getOmrsServiceWorker**(): `Promise`<`Workbox` \| `undefined`\> +`T` & [`BoundActions`](API.md#boundactions) -If a service worker has been registered, returns a promise that resolves to a {@link Workbox} -instance which is used by the application to manage that service worker. +▸ (`actions?`): `T` & [`BoundActions`](API.md#boundactions) -If no service worker has been registered (e.g. when the application is built without offline specific features), -returns a promise which immediately resolves to `undefined`. +##### Parameters -#### Returns +| Name | Type | +| :------ | :------ | +| `actions?` | [`Actions`](API.md#actions) | -`Promise`<`Workbox` \| `undefined`\> +##### Returns -A promise which either resolves to `undefined` or to the app's {@link Workbox} instance. +`T` & [`BoundActions`](API.md#boundactions) #### Defined in -[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) +[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) ___ -### getSyncLifecycle - -▸ **getSyncLifecycle**<`T`\>(`Component`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\> - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters +### getAppState -| Name | Type | -| :------ | :------ | -| `Component` | `ComponentType`<`T`\> | -| `options` | [`ComponentDecoratorOptions`](interfaces/ComponentDecoratorOptions.md) | +▸ **getAppState**(): `Store`<[`AppState`](interfaces/AppState.md)\> #### Returns -`fn` - -▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\> - -##### Returns +`Store`<[`AppState`](interfaces/AppState.md)\> -`Promise`<`ReactAppOrParcel`<`any`\>\> +The [store](https://github.com/developit/unistore#store) named `app`. #### Defined in -[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) +[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) ___ -### getSynchronizationItem +### getGlobalStore -▸ **getSynchronizationItem**<`T`\>(`id`): `Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\> \| `undefined`\> +▸ **getGlobalStore**<`TState`\>(`name`, `fallbackState?`): `Store`<`TState`\> -Returns a queued sync item with the given ID or `undefined` if no such item exists. +Returns the existing [store](https://github.com/developit/unistore#store) named `name`, +or creates a new store named `name` if none exists. #### Type parameters | Name | Type | | :------ | :------ | -| `T` | `any` | +| `TState` | `any` | #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `id` | `number` | The ID of the requested sync item. | +| `name` | `string` | The name of the store to look up. | +| `fallbackState?` | `TState` | The initial value of the new store if no store named `name` exists. | #### Returns -`Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\> \| `undefined`\> +`Store`<`TState`\> + +The found or newly created store. #### Defined in -[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) +[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) ___ -### getSynchronizationItems - -▸ **getSynchronizationItems**<`T`\>(`type`): `Promise`<`T`[]\> +### subscribeTo -Returns all currently queued up sync items of the currently signed in user. +▸ **subscribeTo**<`T`, `U`\>(`store`, `select`, `handle`): `Unsubscribe` #### Type parameters | Name | | :------ | | `T` | +| `U` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `type` | `string` | The identifying type of the synchronization items to be returned. | +| Name | Type | +| :------ | :------ | +| `store` | `Store`<`T`\> | +| `select` | (`state`: `T`) => `U` | +| `handle` | (`subState`: `U`) => `void` | #### Returns -`Promise`<`T`[]\> +`Unsubscribe` #### Defined in -[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) +[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) ___ -### getSynchronizationItemsFor - -▸ **getSynchronizationItemsFor**<`T`\>(`userId`, `type`): `Promise`<`T`[]\> +### useStore -Returns all currently queued up sync items of a given user. +▸ **useStore**<`T`, `U`\>(`store`): `T` #### Type parameters | Name | | :------ | | `T` | +| `U` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `userId` | `string` | The ID of the user whose synchronization items should be returned. | -| `type` | `string` | The identifying type of the synchronization items to be returned.. | +| Name | Type | +| :------ | :------ | +| `store` | `Store`<`T`\> | #### Returns -`Promise`<`T`[]\> +`T` #### Defined in -[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) - -___ - -### handleApiError - -▸ **handleApiError**(): (`incomingResponseErr`: `any`) => `void` +[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) -#### Returns +▸ **useStore**<`T`, `U`\>(`store`, `select`): `U` -`fn` +#### Type parameters -▸ (`incomingResponseErr`): `void` +| Name | +| :------ | +| `T` | +| `U` | -##### Parameters +#### Parameters | Name | Type | | :------ | :------ | -| `incomingResponseErr` | `any` | +| `store` | `Store`<`T`\> | +| `select` | (`state`: `T`) => `U` | -##### Returns +#### Returns -`void` +`U` #### Defined in -[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) - -___ +[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) -### inRange +▸ **useStore**<`T`, `U`\>(`store`, `select`, `actions`): `T` & [`BoundActions`](API.md#boundactions) -▸ `Const` **inRange**(`min`, `max`): [`Validator`](API.md#validator) +#### Type parameters -Verifies that the value is between the provided minimum and maximum +| Name | +| :------ | +| `T` | +| `U` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `min` | `number` | Minimum acceptable value | -| `max` | `number` | Maximum acceptable value | - -#### Returns - -[`Validator`](API.md#validator) - -#### Defined in - -[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) - -___ - -### integrateBreakpoints - -▸ **integrateBreakpoints**(): `void` +| Name | Type | +| :------ | :------ | +| `store` | `Store`<`T`\> | +| `select` | `undefined` | +| `actions` | [`Actions`](API.md#actions) | #### Returns -`void` +`T` & [`BoundActions`](API.md#boundactions) #### Defined in -[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) +[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) -___ - -### isOfflineUuid +▸ **useStore**<`T`, `U`\>(`store`, `select`, `actions`): `U` & [`BoundActions`](API.md#boundactions) -▸ **isOfflineUuid**(`uuid`): `boolean` +#### Type parameters -Checks whether the given string has the format of an offline UUID generated by [generateOfflineUuid](API.md#generateofflineuuid) +| Name | +| :------ | +| `T` | +| `U` | #### Parameters | Name | Type | | :------ | :------ | -| `uuid` | `string` | +| `store` | `Store`<`T`\> | +| `select` | (`state`: `T`) => `U` | +| `actions` | [`Actions`](API.md#actions) | #### Returns -`boolean` +`U` & [`BoundActions`](API.md#boundactions) #### Defined in -[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) +[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) ___ -### isSameDay - -▸ **isSameDay**(`firstDate`, `secondDate`): `boolean` - -Checks if two dates are representing the same day. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `firstDate` | `Date` | The first date. | -| `secondDate` | `Date` | The second date. | - -#### Returns - -`boolean` - -True if both are located on the same day. - -#### Defined in - -[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) +### useStoreWithActions -___ +▸ **useStoreWithActions**<`T`\>(`store`, `actions`): `T` & [`BoundActions`](API.md#boundactions) -### isVersionSatisfied +#### Type parameters -▸ **isVersionSatisfied**(`requiredVersion`, `installedVersion`): `boolean` +| Name | +| :------ | +| `T` | #### Parameters | Name | Type | | :------ | :------ | -| `requiredVersion` | `string` | -| `installedVersion` | `string` | +| `store` | `Store`<`T`\> | +| `actions` | [`Actions`](API.md#actions) | #### Returns -`boolean` +`T` & [`BoundActions`](API.md#boundactions) #### Defined in -[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) +[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) ___ -### loadPersistedPatientDataSyncState - -▸ **loadPersistedPatientDataSyncState**(): `Promise`<`void`\> - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[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) - -___ +## UI Functions -### messageOmrsServiceWorker +### showModal -▸ **messageOmrsServiceWorker**(`message`): `Promise`<[`MessageServiceWorkerResult`](interfaces/MessageServiceWorkerResult.md)<`any`\>\> +▸ **showModal**(`extensionId`, `props?`, `onClose?`): () => `void` -Sends the specified message to the application's service worker. +Shows the provided extension component in a modal dialog. #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `message` | [`KnownOmrsServiceWorkerMessages`](API.md#knownomrsserviceworkermessages) | The message to be sent. | +| `extensionId` | `string` | The id of the extension to show. | +| `props` | `Record`<`string`, `any`\> | The optional props to provide to the extension. | +| `onClose` | () => `void` | The optional notification to receive when the modal is closed. | #### Returns -`Promise`<[`MessageServiceWorkerResult`](interfaces/MessageServiceWorkerResult.md)<`any`\>\> - -A promise which completes when the message has been successfully processed by the Service Worker. - -#### Defined in - -[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) - -___ +`fn` -### openmrsComponentDecorator +The dispose function to force closing the modal dialog. -▸ **openmrsComponentDecorator**(`userOpts`): (`Comp`: `ComponentType`<{}\>) => `ComponentType`<`any`\> +▸ (): `void` -#### Parameters +##### Returns -| Name | Type | -| :------ | :------ | -| `userOpts` | [`ComponentDecoratorOptions`](interfaces/ComponentDecoratorOptions.md) | +`void` -#### Returns +#### Defined in -`fn` +[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) -▸ (`Comp`): `ComponentType`<`any`\> +___ -##### Parameters - -| Name | Type | -| :------ | :------ | -| `Comp` | `ComponentType`<{}\> | - -##### Returns - -`ComponentType`<`any`\> - -#### Defined in - -[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) - -___ - -### patchXMLHttpRequest - -▸ **patchXMLHttpRequest**(): `void` - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### processConfig - -▸ **processConfig**(`schema`, `providedConfig`, `keyPathContext`, `devDefaultsAreOn?`): [`Config`](interfaces/Config.md) - -Validate and interpolate defaults for `providedConfig` according to `schema` - -#### Parameters - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `schema` | [`ConfigSchema`](interfaces/ConfigSchema.md) | `undefined` | a configuration schema | -| `providedConfig` | [`ConfigObject`](interfaces/ConfigObject.md) | `undefined` | an object of config values (without the top-level module name) | -| `keyPathContext` | `string` | `undefined` | a dot-deparated string which helps the user figure out where the provided config came from | -| `devDefaultsAreOn` | `boolean` | `false` | - | - -#### Returns - -[`Config`](interfaces/Config.md) - -#### Defined in - -[packages/framework/esm-config/src/module-config/module-config.ts:275](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/module-config.ts#L275) - -___ - -### provide - -▸ **provide**(`config`, `sourceName?`): `void` - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `config` | [`Config`](interfaces/Config.md) | `undefined` | -| `sourceName` | `string` | `"provided"` | - -#### Returns - -`void` - -#### Defined in - -[packages/framework/esm-config/src/module-config/module-config.ts:233](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/module-config.ts#L233) - -___ - -### pushNavigationContext - -▸ **pushNavigationContext**(`_context`): () => `void` - -**`deprecated`** don't use - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `_context` | [`NavigationContext`](interfaces/NavigationContext.md) | - -#### Returns - -`fn` - -▸ (): `void` - -##### Returns - -`void` - -#### Defined in - -[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) - -___ - -### queueSynchronizationItem - -▸ **queueSynchronizationItem**<`T`\>(`type`, `content`, `descriptor?`): `Promise`<`number`\> - -Enqueues a new item in the sync queue and associates the item with the currently signed in user. - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `type` | `string` | The identifying type of the synchronization item. | -| `content` | `T` | The actual data to be synchronized. | -| `descriptor?` | [`QueueItemDescriptor`](interfaces/QueueItemDescriptor.md) | An optional descriptor providing additional metadata about the sync item. | - -#### Returns - -`Promise`<`number`\> - -#### Defined in - -[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) - -___ - -### queueSynchronizationItemFor - -▸ **queueSynchronizationItemFor**<`T`\>(`userId`, `type`, `content`, `descriptor?`): `Promise`<`number`\> - -Enqueues a new item in the sync queue for a specific user. - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `userId` | `string` | The user with whom the sync item should be associated with. | -| `type` | `string` | The identifying type of the synchronization item. | -| `content` | `T` | The actual data to be synchronized. | -| `descriptor?` | [`QueueItemDescriptor`](interfaces/QueueItemDescriptor.md) | An optional descriptor providing additional metadata about the sync item. | - -#### Returns - -`Promise`<`number`\> - -#### Defined in - -[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) - -___ - -### registerOfflinePatientHandler - -▸ **registerOfflinePatientHandler**(`identifier`, `handler`): `void` - -Attempts to add the specified patient handler registration to the list of offline patient handlers. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `identifier` | `string` | A key which uniquely identifies the registration. | -| `handler` | [`OfflinePatientDataSyncHandler`](interfaces/OfflinePatientDataSyncHandler.md) | The patient handler registration to be registered. | - -#### Returns - -`void` - -`true` if the registration was successfully made; `false` if another registration with - the same identifier has already been registered before. - -#### Defined in - -[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) - -___ - -### registerOmrsServiceWorker - -▸ **registerOmrsServiceWorker**(`scriptUrl`, `registerOptions?`): `Promise`<`Workbox`\> - -If not yet registered, registers the application's global Service Worker. -Throws if registration is not possible. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `scriptUrl` | `string` | -| `registerOptions?` | `object` | - -#### Returns - -`Promise`<`Workbox`\> - -A promise which resolves to the registered {@link Workbox} instance which manages the SW. - -#### Defined in - -[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) - -___ - -### renderExtension - -▸ **renderExtension**(`domElement`, `extensionSlotName`, `extensionSlotModuleName`, `extensionId`, `renderFunction?`, `additionalProps?`): [`CancelLoading`](interfaces/CancelLoading.md) - -Mounts into a DOM node (representing an extension slot) -a lazy-loaded component from *any* frontend module -that registered an extension component for this slot. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `domElement` | `HTMLElement` | -| `extensionSlotName` | `string` | -| `extensionSlotModuleName` | `string` | -| `extensionId` | `string` | -| `renderFunction` | (`lifecycle`: [`Lifecycle`](interfaces/Lifecycle.md)) => [`Lifecycle`](interfaces/Lifecycle.md) | -| `additionalProps` | `Record`<`string`, `any`\> | - -#### Returns - -[`CancelLoading`](interfaces/CancelLoading.md) - -#### Defined in - -[packages/framework/esm-extensions/src/render.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/render.ts#L16) - -___ - -### renderInlineNotifications - -▸ **renderInlineNotifications**(`target`): `void` - -Starts a rendering host for inline notifications. Should only be used by the app shell. -Under normal conditions there is no need to use this function. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `target` | ``null`` \| `HTMLElement` | The container target that hosts the inline notifications. | - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### renderLoadingSpinner - -▸ **renderLoadingSpinner**(`target`): () => `any` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `target` | `HTMLElement` | - -#### Returns - -`fn` - -▸ (): `any` - -##### Returns - -`any` - -#### Defined in - -[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) - -___ - -### renderModals - -▸ **renderModals**(`modalContainer`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `modalContainer` | ``null`` \| `HTMLElement` | - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### renderToasts - -▸ **renderToasts**(`target`): `void` - -Starts a rendering host for toast notifications. Should only be used by the app shell. -Under normal conditions there is no need to use this function. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `target` | ``null`` \| `HTMLElement` | The container target that hosts the toast notifications. | - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### reportError - -▸ **reportError**(`err`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `err` | `any` | - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### retry - -▸ **retry**<`T`\>(`fn`, `options?`): `Promise`<`T`\> - -Executes the specified function and retries executing on failure with a custom backoff strategy -defined by the options. - -If not configured otherwise, this function uses the following default options: -* Retries 5 times beyond the initial attempt. -* Uses an exponential backoff starting with an initial delay of 1000ms. - -**`throws`** Rethrows the final error of running `fn` when the function stops retrying. - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `fn` | () => `Promise`<`T`\> | The function to be executed and retried on failure. | -| `options` | [`RetryOptions`](interfaces/RetryOptions.md) | Additional options which configure the retry behavior. | - -#### Returns - -`Promise`<`T`\> - -The result of successfully executing `fn`. - -#### Defined in - -[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) - -___ - -### runSynchronization - -▸ **runSynchronization**(): `Promise`<`void`\> - -Runs a full synchronization of **all** queued synchronization items. - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[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) - -___ - -### setCurrentOfflineMode - -▸ **setCurrentOfflineMode**(`mode`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `mode` | [`OfflineMode`](API.md#offlinemode) | - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### setupOfflineSync - -▸ **setupOfflineSync**<`T`\>(`type`, `dependsOn`, `process`, `options?`): `void` - -Registers a new synchronization handler which is able to synchronize data of a specific type. - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `type` | `string` | The identifying type of the synchronization items which can be handled by this handler. | -| `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. | -| `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). | -| `options` | `SetupOfflineSyncOptions`<`T`\> | Additional options which can optionally be provided when setting up a synchronization callback for a specific synchronization item type. | - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### setupPaths - -▸ **setupPaths**(`config`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `config` | [`SpaConfig`](interfaces/SpaConfig.md) | - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### setupUtils - -▸ **setupUtils**(): `void` - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### showModal - -▸ **showModal**(`extensionId`, `props?`, `onClose?`): () => `void` - -Shows the provided extension component in a modal dialog. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `extensionId` | `string` | The id of the extension to show. | -| `props` | `Record`<`string`, `any`\> | The optional props to provide to the extension. | -| `onClose` | () => `void` | The optional notification to receive when the modal is closed. | - -#### Returns - -`fn` - -The dispose function to force closing the modal dialog. - -▸ (): `void` - -##### Returns - -`void` - -#### Defined in - -[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) - -___ - -### showNotification - -▸ **showNotification**(`notification`): `void` - -Displays an inline notification in the UI. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `notification` | `NotificationDescriptor` | The description of the notification to display. | - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### showToast - -▸ **showToast**(`toast`): `void` - -Displays a toast notification in the UI. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `toast` | `ToastDescriptor` | The description of the toast to display. | - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### subscribeConnectivity - -▸ **subscribeConnectivity**(`cb`): () => `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `cb` | (`ev`: [`ConnectivityChangedEvent`](interfaces/ConnectivityChangedEvent.md)) => `void` | - -#### Returns - -`fn` - -▸ (): `void` - -##### Returns - -`void` - -#### Defined in - -[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) - -___ - -### subscribeConnectivityChanged - -▸ **subscribeConnectivityChanged**(`cb`): () => `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `cb` | (`ev`: [`ConnectivityChangedEvent`](interfaces/ConnectivityChangedEvent.md)) => `void` | - -#### Returns - -`fn` - -▸ (): `void` - -##### Returns - -`void` - -#### Defined in - -[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) - -___ - -### subscribeNetworkRequestFailed - -▸ **subscribeNetworkRequestFailed**(`cb`): () => `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `cb` | (`data`: [`NetworkRequestFailedEvent`](interfaces/NetworkRequestFailedEvent.md)) => `void` | - -#### Returns - -`fn` - -▸ (): `void` - -##### Returns - -`void` - -#### Defined in - -[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) - -___ - -### subscribeNotificationShown - -▸ **subscribeNotificationShown**(`cb`): () => `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `cb` | (`data`: [`ShowNotificationEvent`](interfaces/ShowNotificationEvent.md)) => `void` | - -#### Returns - -`fn` - -▸ (): `void` - -##### Returns - -`void` - -#### Defined in - -[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) - -___ - -### subscribePrecacheStaticDependencies - -▸ **subscribePrecacheStaticDependencies**(`cb`): () => `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `cb` | (`data`: [`PrecacheStaticDependenciesEvent`](interfaces/PrecacheStaticDependenciesEvent.md)) => `void` | - -#### Returns - -`fn` - -▸ (): `void` - -##### Returns - -`void` - -#### Defined in - -[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) - -___ - -### subscribeTo - -▸ **subscribeTo**<`T`, `U`\>(`store`, `select`, `handle`): `Unsubscribe` - -#### Type parameters - -| Name | -| :------ | -| `T` | -| `U` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `store` | `Store`<`T`\> | -| `select` | (`state`: `T`) => `U` | -| `handle` | (`subState`: `U`) => `void` | - -#### Returns - -`Unsubscribe` - -#### Defined in - -[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) - -___ - -### subscribeToastShown - -▸ **subscribeToastShown**(`cb`): () => `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `cb` | (`data`: [`ShowToastEvent`](interfaces/ShowToastEvent.md)) => `void` | - -#### Returns - -`fn` - -▸ (): `void` - -##### Returns - -`void` - -#### Defined in - -[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) - -___ - -### switchTo - -▸ **switchTo**<`T`\>(`_type`, `link`, `_state?`): `void` - -**`deprecated`** use `navigate` directly - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `_type` | [`NavigationContextType`](API.md#navigationcontexttype) | -| `link` | `string` | -| `_state?` | `T` | - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### syncOfflinePatientData - -▸ **syncOfflinePatientData**(`patientUuid`): `Promise`<`void`\> - -Notifies all registered offline patient handlers that a new patient must be made available offline. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `patientUuid` | `string` | - -#### Returns - -`Promise`<`void`\> - -A promise which resolves once all registered handlers have finished synchronizing. - -#### Defined in - -[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) - -___ - -### translateFrom - -▸ **translateFrom**(`moduleName`, `key`, `fallback?`, `options?`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `moduleName` | `string` | -| `key` | `string` | -| `fallback?` | `string` | -| `options?` | `object` | - -#### Returns - -`string` - -#### Defined in - -[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) - -___ - -### useAssignedExtensionIds - -▸ **useAssignedExtensionIds**(`slotName`): `string`[] - -Gets the assigned extension ids for a given extension slot name. -Does not consider if offline or online. - -**`deprecated`** Use `useAssignedExtensions` - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `slotName` | `string` | The name of the slot to get the assigned IDs for. | - -#### Returns - -`string`[] - -#### Defined in - -[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) - -___ - -### useAssignedExtensions - -▸ **useAssignedExtensions**(`slotName`): [`AssignedExtension`](interfaces/AssignedExtension.md)[] - -Gets the assigned extensions for a given extension slot name. -Does not consider if offline or online. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `slotName` | `string` | The name of the slot to get the assigned extensions for. | - -#### Returns - -[`AssignedExtension`](interfaces/AssignedExtension.md)[] - -#### Defined in - -[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) - -___ - -### useBodyScrollLock - -▸ **useBodyScrollLock**(`active`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `active` | `boolean` | - -#### Returns - -`void` - -#### Defined in - -[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) - -___ - -### useConfig - -▸ **useConfig**(): `Object` - -Use this React Hook to obtain your module's configuration. - -#### Returns - -`Object` - -| Name | Type | Description | -| :------ | :------ | :------ | -| `constructor` | `Function` | The initial value of Object.prototype.constructor is the standard built-in Object constructor. | -| `hasOwnProperty` | (`v`: `PropertyKey`) => `boolean` | Determines whether an object has a property with the specified name. | -| `isPrototypeOf` | (`v`: `Object`) => `boolean` | Determines whether an object exists in another object's prototype chain. | -| `propertyIsEnumerable` | (`v`: `PropertyKey`) => `boolean` | Determines whether a specified property is enumerable. | -| `toLocaleString` | () => `string` | Returns a date converted to a string using the current locale. | -| `toString` | () => `string` | Returns a string representation of an object. | -| `valueOf` | () => `Object` | Returns the primitive value of the specified object. | - -#### Defined in - -[packages/framework/esm-react-utils/src/useConfig.ts:162](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useConfig.ts#L162) - -___ - -### useConnectedExtensions - -▸ **useConnectedExtensions**(`slotName`): [`ConnectedExtension`](interfaces/ConnectedExtension.md)[] - -Gets the assigned extension for a given extension slot name. -Considers if offline or online. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `slotName` | `string` | The name of the slot to get the assigned extensions for. | - -#### Returns - -[`ConnectedExtension`](interfaces/ConnectedExtension.md)[] - -#### Defined in - -[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) - -___ - -### useConnectivity - -▸ **useConnectivity**(): `boolean` - -#### Returns - -`boolean` - -#### Defined in - -[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) - -___ - -### useCurrentPatient - -▸ **useCurrentPatient**(`patientUuid?`): [`boolean`, `NullablePatient`, [`PatientUuid`](API.md#patientuuid), `Error` \| ``null``] - -This React hook returns the current patient, as specified by the current route. It returns -all the information needed to render a loading state, error state, and normal/success state. - -**`deprecated`** Use [usePatient](API.md#usepatient) instead. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `patientUuid` | [`PatientUuid`](API.md#patientuuid) | - -#### Returns - -[`boolean`, `NullablePatient`, [`PatientUuid`](API.md#patientuuid), `Error` \| ``null``] - -#### Defined in - -[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) - -___ - -### useExtensionSlotMeta - -▸ **useExtensionSlotMeta**<`T`\>(`extensionSlotName`): `Object` - -Extract meta data from all extension for a given extension slot. - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | [`ExtensionMeta`](interfaces/ExtensionMeta.md) | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `extensionSlotName` | `string` | - -#### Returns - -`Object` - -#### Defined in +### showNotification -[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) +▸ **showNotification**(`notification`): `void` -___ +Displays an inline notification in the UI. -### useExtensionStore +#### Parameters -▸ `Const` **useExtensionStore**(): `T` +| Name | Type | Description | +| :------ | :------ | :------ | +| `notification` | [`NotificationDescriptor`](interfaces/NotificationDescriptor.md) | The description of the notification to display. | #### Returns -`T` +`void` #### Defined in -[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) +[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) -▸ `Const` **useExtensionStore**(`actions`): `T` & [`BoundActions`](API.md#boundactions) +___ + +### showToast + +▸ **showToast**(`toast`): `void` + +Displays a toast notification in the UI. #### Parameters -| Name | Type | -| :------ | :------ | -| `actions` | [`Actions`](API.md#actions) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `toast` | [`ToastDescriptor`](interfaces/ToastDescriptor.md) | The description of the toast to display. | #### Returns -`T` & [`BoundActions`](API.md#boundactions) +`void` #### Defined in -[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) +[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) -▸ `Const` **useExtensionStore**(`actions?`): `T` & [`BoundActions`](API.md#boundactions) +___ + +### subscribeNotificationShown + +▸ **subscribeNotificationShown**(`cb`): () => `void` #### Parameters | Name | Type | | :------ | :------ | -| `actions?` | [`Actions`](API.md#actions) | +| `cb` | (`data`: [`ShowNotificationEvent`](interfaces/ShowNotificationEvent.md)) => `void` | #### Returns -`T` & [`BoundActions`](API.md#boundactions) +`fn` + +▸ (): `void` + +##### Returns + +`void` #### Defined in -[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) +[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) ___ -### useForceUpdate +### subscribeToastShown + +▸ **subscribeToastShown**(`cb`): () => `void` + +#### Parameters -▸ **useForceUpdate**(): () => `void` +| Name | Type | +| :------ | :------ | +| `cb` | (`data`: [`ShowToastEvent`](interfaces/ShowToastEvent.md)) => `void` | #### Returns @@ -4034,35 +3389,41 @@ ___ #### Defined in -[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) +[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) ___ -### useLayoutType +### useBodyScrollLock -▸ **useLayoutType**(): [`LayoutType`](API.md#layouttype) +▸ **useBodyScrollLock**(`active`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `active` | `boolean` | #### Returns -[`LayoutType`](API.md#layouttype) +`void` #### Defined in -[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) +[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) ___ -### useLocations +### useLayoutType -▸ **useLocations**(): [`Location`](interfaces/Location.md)[] +▸ **useLayoutType**(): [`LayoutType`](API.md#layouttype) #### Returns -[`Location`](interfaces/Location.md)[] +[`LayoutType`](API.md#layouttype) #### Defined in -[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) +[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) ___ @@ -4089,7 +3450,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -4128,160 +3489,118 @@ ___ #### Defined in -[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) +[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) ___ -### usePatient +## Utility Functions -▸ **usePatient**(`patientUuid?`): `Object` +### age -This React hook returns a patient object. If the `patientUuid` is provided -as a parameter, then the patient for that UUID is returned. If the parameter -is not provided, the patient UUID is obtained from the current route, and -a route listener is set up to update the patient whenever the route changes. +▸ **age**(`dateString`): `string` + +Gets a human readable age represention of the provided date string. #### Parameters -| Name | Type | -| :------ | :------ | -| `patientUuid?` | `string` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `dateString` | `string` | The stringified date. | #### Returns -`Object` - -| Name | Type | -| :------ | :------ | -| `error` | ``null`` \| `Error` | -| `isLoading` | `boolean` | -| `patient` | `NullablePatient` | -| `patientUuid` | ``null`` \| `string` | - -#### Defined in - -[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) - -___ - -### useSessionUser - -▸ **useSessionUser**(): ``null`` \| [`SessionUser`](interfaces/SessionUser.md) - -#### Returns +`string` -``null`` \| [`SessionUser`](interfaces/SessionUser.md) +A human-readable string version of the age. #### Defined in -[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) +[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) ___ -### useStore - -▸ **useStore**<`T`, `U`\>(`store`): `T` +### daysIntoYear -#### Type parameters +▸ **daysIntoYear**(`date`): `number` -| Name | -| :------ | -| `T` | -| `U` | +Gets the number of days in the year of the given date. #### Parameters -| Name | Type | -| :------ | :------ | -| `store` | `Store`<`T`\> | +| Name | Type | Description | +| :------ | :------ | :------ | +| `date` | `Date` | The date to compute the days within the year. | #### Returns -`T` +`number` + +The number of days. #### Defined in -[packages/framework/esm-react-utils/src/useStore.ts:22](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useStore.ts#L22) +[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) -▸ **useStore**<`T`, `U`\>(`store`, `select`): `U` +___ -#### Type parameters +### isSameDay -| Name | -| :------ | -| `T` | -| `U` | +▸ **isSameDay**(`firstDate`, `secondDate`): `boolean` + +Checks if two dates are representing the same day. #### Parameters -| Name | Type | -| :------ | :------ | -| `store` | `Store`<`T`\> | -| `select` | (`state`: `T`) => `U` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `firstDate` | `Date` | The first date. | +| `secondDate` | `Date` | The second date. | #### Returns -`U` +`boolean` + +True if both are located on the same day. #### Defined in -[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) +[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) -▸ **useStore**<`T`, `U`\>(`store`, `select`, `actions`): `T` & [`BoundActions`](API.md#boundactions) +___ -#### Type parameters +### isVersionSatisfied -| Name | -| :------ | -| `T` | -| `U` | +▸ **isVersionSatisfied**(`requiredVersion`, `installedVersion`): `boolean` #### Parameters | Name | Type | | :------ | :------ | -| `store` | `Store`<`T`\> | -| `select` | `undefined` | -| `actions` | [`Actions`](API.md#actions) | +| `requiredVersion` | `string` | +| `installedVersion` | `string` | #### Returns -`T` & [`BoundActions`](API.md#boundactions) +`boolean` #### Defined in -[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) - -▸ **useStore**<`T`, `U`\>(`store`, `select`, `actions`): `U` & [`BoundActions`](API.md#boundactions) - -#### Type parameters - -| Name | -| :------ | -| `T` | -| `U` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `store` | `Store`<`T`\> | -| `select` | (`state`: `T`) => `U` | -| `actions` | [`Actions`](API.md#actions) | - -#### Returns +[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) -`U` & [`BoundActions`](API.md#boundactions) +___ -#### Defined in +### retry -[packages/framework/esm-react-utils/src/useStore.ts:29](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useStore.ts#L29) +▸ **retry**<`T`\>(`fn`, `options?`): `Promise`<`T`\> -___ +Executes the specified function and retries executing on failure with a custom backoff strategy +defined by the options. -### useStoreWithActions +If not configured otherwise, this function uses the following default options: +* Retries 5 times beyond the initial attempt. +* Uses an exponential backoff starting with an initial delay of 1000ms. -▸ **useStoreWithActions**<`T`\>(`store`, `actions`): `T` & [`BoundActions`](API.md#boundactions) +**`throws`** Rethrows the final error of running `fn` when the function stops retrying. #### Type parameters @@ -4291,76 +3610,40 @@ ___ #### Parameters -| Name | Type | -| :------ | :------ | -| `store` | `Store`<`T`\> | -| `actions` | [`Actions`](API.md#actions) | - -#### Returns - -`T` & [`BoundActions`](API.md#boundactions) - -#### Defined in - -[packages/framework/esm-react-utils/src/useStore.ts:51](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useStore.ts#L51) - -___ - -### useVisit - -▸ **useVisit**(`patientUuid`): `VisitReturnType` - -This React hook returns a visit object. If the `patientUuid` is provided -as a parameter, then the currentVisit, error and mutate function -for that patient visit is returned. - -#### Parameters - | Name | Type | Description | | :------ | :------ | :------ | -| `patientUuid` | `string` | Unique patient identifier `string` | +| `fn` | () => `Promise`<`T`\> | The function to be executed and retried on failure. | +| `options` | [`RetryOptions`](interfaces/RetryOptions.md) | Additional options which configure the retry behavior. | #### Returns -`VisitReturnType` - -Object {`error` `isValidating`, `currentVisit`, `mutate`} - -#### Defined in - -[packages/framework/esm-react-utils/src/useVisit.ts:26](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useVisit.ts#L26) - -___ - -### useVisitTypes - -▸ **useVisitTypes**(): [`VisitType`](interfaces/VisitType.md)[] - -#### Returns +`Promise`<`T`\> -[`VisitType`](interfaces/VisitType.md)[] +The result of successfully executing `fn`. #### Defined in -[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) +[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) ___ -### validator +### translateFrom -▸ **validator**(`validationFunction`, `message`): [`Validator`](API.md#validator) +▸ **translateFrom**(`moduleName`, `key`, `fallback?`, `options?`): `string` #### Parameters | Name | Type | | :------ | :------ | -| `validationFunction` | [`ValidatorFunction`](API.md#validatorfunction) | -| `message` | `string` | +| `moduleName` | `string` | +| `key` | `string` | +| `fallback?` | `string` | +| `options?` | `object` | #### Returns -[`Validator`](API.md#validator) +`string` #### Defined in -[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) +[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) diff --git a/packages/framework/esm-framework/docs/classes/OpenmrsFetchError.md b/packages/framework/esm-framework/docs/classes/OpenmrsFetchError.md index 0ed6109b3..cd68b3850 100644 --- a/packages/framework/esm-framework/docs/classes/OpenmrsFetchError.md +++ b/packages/framework/esm-framework/docs/classes/OpenmrsFetchError.md @@ -52,7 +52,7 @@ Error.constructor #### Defined in -[packages/framework/esm-api/src/openmrs-fetch.ts:275](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/openmrs-fetch.ts#L275) +[packages/framework/esm-api/src/openmrs-fetch.ts:281](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/openmrs-fetch.ts#L281) ## API Properties @@ -62,7 +62,7 @@ Error.constructor #### Defined in -[packages/framework/esm-api/src/openmrs-fetch.ts:288](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/openmrs-fetch.ts#L288) +[packages/framework/esm-api/src/openmrs-fetch.ts:294](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/openmrs-fetch.ts#L294) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/openmrs-fetch.ts:289](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/openmrs-fetch.ts#L289) +[packages/framework/esm-api/src/openmrs-fetch.ts:295](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/openmrs-fetch.ts#L295) ___ diff --git a/packages/framework/esm-framework/docs/enums/VisitMode.md b/packages/framework/esm-framework/docs/enums/VisitMode.md index 6f78c4a34..3df030026 100644 --- a/packages/framework/esm-framework/docs/enums/VisitMode.md +++ b/packages/framework/esm-framework/docs/enums/VisitMode.md @@ -18,7 +18,7 @@ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:89](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L89) +[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:85](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L85) ___ @@ -28,7 +28,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:90](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L90) +[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:86](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L86) ___ @@ -38,4 +38,4 @@ ___ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:88](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L88) +[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:84](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L84) diff --git a/packages/framework/esm-framework/docs/enums/VisitStatus.md b/packages/framework/esm-framework/docs/enums/VisitStatus.md index 45b625868..1b66a342c 100644 --- a/packages/framework/esm-framework/docs/enums/VisitStatus.md +++ b/packages/framework/esm-framework/docs/enums/VisitStatus.md @@ -17,7 +17,7 @@ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:94](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L94) +[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:90](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L90) ___ @@ -27,4 +27,4 @@ ___ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:95](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L95) +[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:91](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L91) diff --git a/packages/framework/esm-framework/docs/interfaces/AssignedExtension.md b/packages/framework/esm-framework/docs/interfaces/AssignedExtension.md index 20ec945c6..07e033671 100644 --- a/packages/framework/esm-framework/docs/interfaces/AssignedExtension.md +++ b/packages/framework/esm-framework/docs/interfaces/AssignedExtension.md @@ -4,7 +4,7 @@ ## Table of contents -### Properties +### Extension Properties - [config](AssignedExtension.md#config) - [id](AssignedExtension.md#id) @@ -14,7 +14,7 @@ - [offline](AssignedExtension.md#offline) - [online](AssignedExtension.md#online) -## Properties +## Extension Properties ### config @@ -24,7 +24,7 @@ The extension's config. Note that this will be `null` until the slot is mounted. #### Defined in -[packages/framework/esm-extensions/src/store.ts:78](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L78) +[packages/framework/esm-extensions/src/store.ts:79](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L79) ___ @@ -34,7 +34,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:73](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L73) +[packages/framework/esm-extensions/src/store.ts:74](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L74) ___ @@ -44,7 +44,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:76](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L76) +[packages/framework/esm-extensions/src/store.ts:77](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L77) ___ @@ -54,7 +54,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:75](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L75) +[packages/framework/esm-extensions/src/store.ts:76](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L76) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:74](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L74) +[packages/framework/esm-extensions/src/store.ts:75](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L75) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:80](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L80) +[packages/framework/esm-extensions/src/store.ts:81](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L81) ___ @@ -84,4 +84,4 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:79](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L79) +[packages/framework/esm-extensions/src/store.ts:80](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L80) diff --git a/packages/framework/esm-framework/docs/interfaces/BreadcrumbRegistration.md b/packages/framework/esm-framework/docs/interfaces/BreadcrumbRegistration.md index df99a6291..30a86e5c9 100644 --- a/packages/framework/esm-framework/docs/interfaces/BreadcrumbRegistration.md +++ b/packages/framework/esm-framework/docs/interfaces/BreadcrumbRegistration.md @@ -4,12 +4,12 @@ ## Table of contents -### Properties +### Breadcrumb Properties - [matcher](BreadcrumbRegistration.md#matcher) - [settings](BreadcrumbRegistration.md#settings) -## Properties +## Breadcrumb Properties ### matcher @@ -17,7 +17,7 @@ #### Defined in -[packages/framework/esm-breadcrumbs/src/types.ts:34](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L34) +[packages/framework/esm-breadcrumbs/src/types.ts:36](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L36) ___ @@ -27,4 +27,4 @@ ___ #### Defined in -[packages/framework/esm-breadcrumbs/src/types.ts:35](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L35) +[packages/framework/esm-breadcrumbs/src/types.ts:37](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L37) diff --git a/packages/framework/esm-framework/docs/interfaces/BreadcrumbSettings.md b/packages/framework/esm-framework/docs/interfaces/BreadcrumbSettings.md index ab42e20f0..421fca5fb 100644 --- a/packages/framework/esm-framework/docs/interfaces/BreadcrumbSettings.md +++ b/packages/framework/esm-framework/docs/interfaces/BreadcrumbSettings.md @@ -4,14 +4,14 @@ ## Table of contents -### Properties +### Breadcrumb Properties - [matcher](BreadcrumbSettings.md#matcher) - [parent](BreadcrumbSettings.md#parent) - [path](BreadcrumbSettings.md#path) - [title](BreadcrumbSettings.md#title) -## Properties +## Breadcrumb Properties ### matcher @@ -26,7 +26,7 @@ Can be omitted; the value of `path` is used as the default value. #### Defined in -[packages/framework/esm-breadcrumbs/src/types.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L14) +[packages/framework/esm-breadcrumbs/src/types.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L16) ___ @@ -43,7 +43,7 @@ parent. #### Defined in -[packages/framework/esm-breadcrumbs/src/types.ts:23](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L23) +[packages/framework/esm-breadcrumbs/src/types.ts:25](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L25) ___ @@ -55,7 +55,7 @@ Gets the path of breadcrumb for navigation purposes. #### Defined in -[packages/framework/esm-breadcrumbs/src/types.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L5) +[packages/framework/esm-breadcrumbs/src/types.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L7) ___ @@ -67,4 +67,4 @@ The title of the breadcrumb. #### Defined in -[packages/framework/esm-breadcrumbs/src/types.ts:27](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L27) +[packages/framework/esm-breadcrumbs/src/types.ts:29](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/types.ts#L29) diff --git a/packages/framework/esm-framework/docs/interfaces/CancelLoading.md b/packages/framework/esm-framework/docs/interfaces/CancelLoading.md index 4a63d15fc..57a259546 100644 --- a/packages/framework/esm-framework/docs/interfaces/CancelLoading.md +++ b/packages/framework/esm-framework/docs/interfaces/CancelLoading.md @@ -14,4 +14,4 @@ #### Defined in -[packages/framework/esm-extensions/src/render.ts:8](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/render.ts#L8) +[packages/framework/esm-extensions/src/render.ts:9](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/render.ts#L9) diff --git a/packages/framework/esm-framework/docs/interfaces/ClearDynamicRoutesMessage.md b/packages/framework/esm-framework/docs/interfaces/ClearDynamicRoutesMessage.md index 72380516e..af7b7daf0 100644 --- a/packages/framework/esm-framework/docs/interfaces/ClearDynamicRoutesMessage.md +++ b/packages/framework/esm-framework/docs/interfaces/ClearDynamicRoutesMessage.md @@ -10,11 +10,11 @@ ## Table of contents -### Properties +### Offline Properties - [type](ClearDynamicRoutesMessage.md#type) -## Properties +## Offline Properties ### type @@ -26,4 +26,4 @@ #### Defined in -[packages/framework/esm-offline/src/service-worker-messaging.ts:27](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L27) +[packages/framework/esm-offline/src/service-worker-messaging.ts:28](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L28) diff --git a/packages/framework/esm-framework/docs/interfaces/ComponentConfig.md b/packages/framework/esm-framework/docs/interfaces/ComponentConfig.md deleted file mode 100644 index decf8864a..000000000 --- a/packages/framework/esm-framework/docs/interfaces/ComponentConfig.md +++ /dev/null @@ -1,30 +0,0 @@ -[@openmrs/esm-framework](../API.md) / ComponentConfig - -# Interface: ComponentConfig - -## Table of contents - -### Properties - -- [extension](ComponentConfig.md#extension) -- [moduleName](ComponentConfig.md#modulename) - -## Properties - -### extension - -• `Optional` **extension**: [`ExtensionData`](ExtensionData.md) - -#### Defined in - -[packages/framework/esm-react-utils/src/ComponentContext.ts:11](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ComponentContext.ts#L11) - -___ - -### moduleName - -• **moduleName**: `string` - -#### Defined in - -[packages/framework/esm-react-utils/src/ComponentContext.ts:10](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ComponentContext.ts#L10) diff --git a/packages/framework/esm-framework/docs/interfaces/ComponentDecoratorOptions.md b/packages/framework/esm-framework/docs/interfaces/ComponentDecoratorOptions.md deleted file mode 100644 index 91582d5c7..000000000 --- a/packages/framework/esm-framework/docs/interfaces/ComponentDecoratorOptions.md +++ /dev/null @@ -1,52 +0,0 @@ -[@openmrs/esm-framework](../API.md) / ComponentDecoratorOptions - -# Interface: ComponentDecoratorOptions - -## Table of contents - -### Properties - -- [disableTranslations](ComponentDecoratorOptions.md#disabletranslations) -- [featureName](ComponentDecoratorOptions.md#featurename) -- [moduleName](ComponentDecoratorOptions.md#modulename) -- [strictMode](ComponentDecoratorOptions.md#strictmode) - -## Properties - -### disableTranslations - -• `Optional` **disableTranslations**: `boolean` - -#### Defined in - -[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:57](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L57) - -___ - -### featureName - -• **featureName**: `string` - -#### Defined in - -[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:56](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L56) - -___ - -### moduleName - -• **moduleName**: `string` - -#### Defined in - -[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:55](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L55) - -___ - -### strictMode - -• `Optional` **strictMode**: `boolean` - -#### Defined in - -[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:58](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L58) diff --git a/packages/framework/esm-framework/docs/interfaces/ConfigurableLinkProps.md b/packages/framework/esm-framework/docs/interfaces/ConfigurableLinkProps.md index e8d6c80ac..767350613 100644 --- a/packages/framework/esm-framework/docs/interfaces/ConfigurableLinkProps.md +++ b/packages/framework/esm-framework/docs/interfaces/ConfigurableLinkProps.md @@ -10,11 +10,11 @@ ## Table of contents -### Properties +### Navigation Properties - [to](ConfigurableLinkProps.md#to) -## Properties +## Navigation Properties ### to @@ -22,4 +22,4 @@ #### Defined in -[packages/framework/esm-react-utils/src/ConfigurableLink.tsx:21](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ConfigurableLink.tsx#L21) +[packages/framework/esm-react-utils/src/ConfigurableLink.tsx:22](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ConfigurableLink.tsx#L22) diff --git a/packages/framework/esm-framework/docs/interfaces/ConnectedExtension.md b/packages/framework/esm-framework/docs/interfaces/ConnectedExtension.md index 22d631e99..331efb085 100644 --- a/packages/framework/esm-framework/docs/interfaces/ConnectedExtension.md +++ b/packages/framework/esm-framework/docs/interfaces/ConnectedExtension.md @@ -4,14 +4,14 @@ ## Table of contents -### Properties +### Extension Properties - [config](ConnectedExtension.md#config) - [id](ConnectedExtension.md#id) - [meta](ConnectedExtension.md#meta) - [name](ConnectedExtension.md#name) -## Properties +## Extension Properties ### config @@ -21,7 +21,7 @@ The extension's config. Note that this will be `null` until the slot is mounted. #### Defined in -[packages/framework/esm-extensions/src/store.ts:88](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L88) +[packages/framework/esm-extensions/src/store.ts:89](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L89) ___ @@ -31,7 +31,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:84](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L84) +[packages/framework/esm-extensions/src/store.ts:85](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L85) ___ @@ -41,7 +41,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:86](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L86) +[packages/framework/esm-extensions/src/store.ts:87](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L87) ___ @@ -51,4 +51,4 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:85](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L85) +[packages/framework/esm-extensions/src/store.ts:86](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L86) diff --git a/packages/framework/esm-framework/docs/interfaces/CurrentPatientOptions.md b/packages/framework/esm-framework/docs/interfaces/CurrentPatientOptions.md index 8248c6a95..f0e8513c6 100644 --- a/packages/framework/esm-framework/docs/interfaces/CurrentPatientOptions.md +++ b/packages/framework/esm-framework/docs/interfaces/CurrentPatientOptions.md @@ -24,4 +24,4 @@ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:12](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-patient.ts#L12) +[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:8](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-patient.ts#L8) diff --git a/packages/framework/esm-framework/docs/interfaces/ExtensionInfo.md b/packages/framework/esm-framework/docs/interfaces/ExtensionInfo.md deleted file mode 100644 index c8a5a9f5c..000000000 --- a/packages/framework/esm-framework/docs/interfaces/ExtensionInfo.md +++ /dev/null @@ -1,139 +0,0 @@ -[@openmrs/esm-framework](../API.md) / ExtensionInfo - -# Interface: ExtensionInfo - -## Hierarchy - -- [`ExtensionRegistration`](ExtensionRegistration.md) - - ↳ **`ExtensionInfo`** - -## Table of contents - -### Properties - -- [instances](ExtensionInfo.md#instances) -- [meta](ExtensionInfo.md#meta) -- [moduleName](ExtensionInfo.md#modulename) -- [name](ExtensionInfo.md#name) -- [offline](ExtensionInfo.md#offline) -- [online](ExtensionInfo.md#online) -- [order](ExtensionInfo.md#order) - -### Methods - -- [load](ExtensionInfo.md#load) - -## Properties - -### instances - -• **instances**: [`ExtensionInstance`](ExtensionInstance.md)[] - -The instances where the extension has been rendered using `renderExtension`. - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:28](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L28) - -___ - -### meta - -• **meta**: [`ExtensionMeta`](ExtensionMeta.md) - -#### Inherited from - -[ExtensionRegistration](ExtensionRegistration.md).[meta](ExtensionRegistration.md#meta) - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L18) - -___ - -### moduleName - -• **moduleName**: `string` - -#### Inherited from - -[ExtensionRegistration](ExtensionRegistration.md).[moduleName](ExtensionRegistration.md#modulename) - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L17) - -___ - -### name - -• **name**: `string` - -#### Inherited from - -[ExtensionRegistration](ExtensionRegistration.md).[name](ExtensionRegistration.md#name) - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L15) - -___ - -### offline - -• `Optional` **offline**: `boolean` \| `object` - -#### Inherited from - -[ExtensionRegistration](ExtensionRegistration.md).[offline](ExtensionRegistration.md#offline) - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:21](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L21) - -___ - -### online - -• `Optional` **online**: `boolean` \| `object` - -#### Inherited from - -[ExtensionRegistration](ExtensionRegistration.md).[online](ExtensionRegistration.md#online) - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L20) - -___ - -### order - -• `Optional` **order**: `number` - -#### Inherited from - -[ExtensionRegistration](ExtensionRegistration.md).[order](ExtensionRegistration.md#order) - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L19) - -## Methods - -### load - -▸ **load**(): `Promise`<`any`\> - -#### Returns - -`Promise`<`any`\> - -#### Inherited from - -[ExtensionRegistration](ExtensionRegistration.md).[load](ExtensionRegistration.md#load) - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L16) diff --git a/packages/framework/esm-framework/docs/interfaces/ExtensionInstance.md b/packages/framework/esm-framework/docs/interfaces/ExtensionInstance.md deleted file mode 100644 index fd8b2d277..000000000 --- a/packages/framework/esm-framework/docs/interfaces/ExtensionInstance.md +++ /dev/null @@ -1,41 +0,0 @@ -[@openmrs/esm-framework](../API.md) / ExtensionInstance - -# Interface: ExtensionInstance - -## Table of contents - -### Properties - -- [id](ExtensionInstance.md#id) -- [slotModuleName](ExtensionInstance.md#slotmodulename) -- [slotName](ExtensionInstance.md#slotname) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:32](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L32) - -___ - -### slotModuleName - -• **slotModuleName**: `string` - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:34](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L34) - -___ - -### slotName - -• **slotName**: `string` - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:33](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L33) diff --git a/packages/framework/esm-framework/docs/interfaces/ExtensionInternalStore.md b/packages/framework/esm-framework/docs/interfaces/ExtensionInternalStore.md deleted file mode 100644 index d85dc9f27..000000000 --- a/packages/framework/esm-framework/docs/interfaces/ExtensionInternalStore.md +++ /dev/null @@ -1,34 +0,0 @@ -[@openmrs/esm-framework](../API.md) / ExtensionInternalStore - -# Interface: ExtensionInternalStore - -## Table of contents - -### Properties - -- [extensions](ExtensionInternalStore.md#extensions) -- [slots](ExtensionInternalStore.md#slots) - -## Properties - -### extensions - -• **extensions**: `Record`<`string`, [`ExtensionInfo`](ExtensionInfo.md)\> - -Extensions indexed by name - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L41) - -___ - -### slots - -• **slots**: `Record`<`string`, [`ExtensionSlotInfo`](ExtensionSlotInfo.md)\> - -Slots indexed by name - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:39](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L39) diff --git a/packages/framework/esm-framework/docs/interfaces/ExtensionRegistration.md b/packages/framework/esm-framework/docs/interfaces/ExtensionRegistration.md index ab10ed9a0..59a91b1bc 100644 --- a/packages/framework/esm-framework/docs/interfaces/ExtensionRegistration.md +++ b/packages/framework/esm-framework/docs/interfaces/ExtensionRegistration.md @@ -2,15 +2,9 @@ # Interface: ExtensionRegistration -## Hierarchy - -- **`ExtensionRegistration`** - - ↳ [`ExtensionInfo`](ExtensionInfo.md) - ## Table of contents -### Properties +### Extension Properties - [meta](ExtensionRegistration.md#meta) - [moduleName](ExtensionRegistration.md#modulename) @@ -23,7 +17,7 @@ - [load](ExtensionRegistration.md#load) -## Properties +## Extension Properties ### meta @@ -31,7 +25,7 @@ #### Defined in -[packages/framework/esm-extensions/src/store.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L18) +[packages/framework/esm-extensions/src/store.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L19) ___ @@ -41,7 +35,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L17) +[packages/framework/esm-extensions/src/store.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L18) ___ @@ -51,7 +45,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L15) +[packages/framework/esm-extensions/src/store.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L16) ___ @@ -61,7 +55,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:21](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L21) +[packages/framework/esm-extensions/src/store.ts:22](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L22) ___ @@ -71,7 +65,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L20) +[packages/framework/esm-extensions/src/store.ts:21](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L21) ___ @@ -81,7 +75,7 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L19) +[packages/framework/esm-extensions/src/store.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L20) ## Methods @@ -95,4 +89,4 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L16) +[packages/framework/esm-extensions/src/store.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L17) diff --git a/packages/framework/esm-framework/docs/interfaces/ExtensionSlotInfo.md b/packages/framework/esm-framework/docs/interfaces/ExtensionSlotInfo.md deleted file mode 100644 index 544022705..000000000 --- a/packages/framework/esm-framework/docs/interfaces/ExtensionSlotInfo.md +++ /dev/null @@ -1,64 +0,0 @@ -[@openmrs/esm-framework](../API.md) / ExtensionSlotInfo - -# Interface: ExtensionSlotInfo - -## Table of contents - -### Properties - -- [attachedIds](ExtensionSlotInfo.md#attachedids) -- [config](ExtensionSlotInfo.md#config) -- [moduleName](ExtensionSlotInfo.md#modulename) -- [name](ExtensionSlotInfo.md#name) - -## Properties - -### attachedIds - -• **attachedIds**: `string`[] - -The set of extension IDs which have been attached to this slot using `attach`. -However, not all of these extension IDs should be rendered. -`assignedIds` is the set defining those. - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:58](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L58) - -___ - -### config - -• **config**: ``null`` \| [`ExtensionSlotConfigObject`](ExtensionSlotConfigObject.md) - -The configuration provided for this slot. `null` if not yet loaded. - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:60](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L60) - -___ - -### moduleName - -• `Optional` **moduleName**: `string` - -The module in which the extension slot exists. Undefined if the slot -hasn't been registered yet (but it has been attached or assigned to -an extension. - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:50](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L50) - -___ - -### name - -• **name**: `string` - -The name under which the extension slot has been registered. - -#### Defined in - -[packages/framework/esm-extensions/src/store.ts:52](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L52) diff --git a/packages/framework/esm-framework/docs/interfaces/ExtensionSlotState.md b/packages/framework/esm-framework/docs/interfaces/ExtensionSlotState.md index 59e1a9fd5..8e3cc2116 100644 --- a/packages/framework/esm-framework/docs/interfaces/ExtensionSlotState.md +++ b/packages/framework/esm-framework/docs/interfaces/ExtensionSlotState.md @@ -4,12 +4,12 @@ ## Table of contents -### Properties +### Extension Properties - [assignedExtensions](ExtensionSlotState.md#assignedextensions) - [moduleName](ExtensionSlotState.md#modulename) -## Properties +## Extension Properties ### assignedExtensions @@ -17,7 +17,7 @@ #### Defined in -[packages/framework/esm-extensions/src/store.ts:69](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L69) +[packages/framework/esm-extensions/src/store.ts:70](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L70) ___ @@ -27,4 +27,4 @@ ___ #### Defined in -[packages/framework/esm-extensions/src/store.ts:68](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L68) +[packages/framework/esm-extensions/src/store.ts:69](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L69) diff --git a/packages/framework/esm-framework/docs/interfaces/ExtensionStore.md b/packages/framework/esm-framework/docs/interfaces/ExtensionStore.md index ed05fb6ea..66aa2b4d5 100644 --- a/packages/framework/esm-framework/docs/interfaces/ExtensionStore.md +++ b/packages/framework/esm-framework/docs/interfaces/ExtensionStore.md @@ -4,11 +4,11 @@ ## Table of contents -### Properties +### Extension Properties - [slots](ExtensionStore.md#slots) -## Properties +## Extension Properties ### slots @@ -16,4 +16,4 @@ #### Defined in -[packages/framework/esm-extensions/src/store.ts:64](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L64) +[packages/framework/esm-extensions/src/store.ts:65](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L65) diff --git a/packages/framework/esm-framework/docs/interfaces/FHIRRequestObj.md b/packages/framework/esm-framework/docs/interfaces/FHIRRequestObj.md index 2a63f2e5c..683dd64a1 100644 --- a/packages/framework/esm-framework/docs/interfaces/FHIRRequestObj.md +++ b/packages/framework/esm-framework/docs/interfaces/FHIRRequestObj.md @@ -18,7 +18,7 @@ #### Defined in -[packages/framework/esm-api/src/fhir.ts:53](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/fhir.ts#L53) +[packages/framework/esm-api/src/fhir.ts:50](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/fhir.ts#L50) ___ @@ -28,7 +28,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/fhir.ts:52](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/fhir.ts#L52) +[packages/framework/esm-api/src/fhir.ts:49](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/fhir.ts#L49) ___ @@ -38,4 +38,4 @@ ___ #### Defined in -[packages/framework/esm-api/src/fhir.ts:51](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/fhir.ts#L51) +[packages/framework/esm-api/src/fhir.ts:48](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/fhir.ts#L48) diff --git a/packages/framework/esm-framework/docs/interfaces/MessageServiceWorkerResult.md b/packages/framework/esm-framework/docs/interfaces/MessageServiceWorkerResult.md index 18e2c806d..ee1a4cc98 100644 --- a/packages/framework/esm-framework/docs/interfaces/MessageServiceWorkerResult.md +++ b/packages/framework/esm-framework/docs/interfaces/MessageServiceWorkerResult.md @@ -10,13 +10,13 @@ ## Table of contents -### Properties +### Offline Properties - [error](MessageServiceWorkerResult.md#error) - [result](MessageServiceWorkerResult.md#result) - [success](MessageServiceWorkerResult.md#success) -## Properties +## Offline Properties ### error @@ -24,7 +24,7 @@ #### Defined in -[packages/framework/esm-offline/src/service-worker-messaging.ts:53](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L53) +[packages/framework/esm-offline/src/service-worker-messaging.ts:54](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L54) ___ @@ -34,7 +34,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/service-worker-messaging.ts:52](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L52) +[packages/framework/esm-offline/src/service-worker-messaging.ts:53](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L53) ___ @@ -44,4 +44,4 @@ ___ #### Defined in -[packages/framework/esm-offline/src/service-worker-messaging.ts:51](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L51) +[packages/framework/esm-offline/src/service-worker-messaging.ts:52](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L52) diff --git a/packages/framework/esm-framework/docs/interfaces/NavigateOptions.md b/packages/framework/esm-framework/docs/interfaces/NavigateOptions.md index b8da1fd18..85bf4fdd4 100644 --- a/packages/framework/esm-framework/docs/interfaces/NavigateOptions.md +++ b/packages/framework/esm-framework/docs/interfaces/NavigateOptions.md @@ -4,11 +4,11 @@ ## Table of contents -### Properties +### Navigation Properties - [to](NavigateOptions.md#to) -## Properties +## Navigation Properties ### to @@ -16,4 +16,4 @@ #### Defined in -[packages/framework/esm-config/src/navigation/navigate.ts:10](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/navigate.ts#L10) +[packages/framework/esm-config/src/navigation/navigate.ts:11](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/navigate.ts#L11) diff --git a/packages/framework/esm-framework/docs/interfaces/NavigationContext.md b/packages/framework/esm-framework/docs/interfaces/NavigationContext.md deleted file mode 100644 index 625d08d68..000000000 --- a/packages/framework/esm-framework/docs/interfaces/NavigationContext.md +++ /dev/null @@ -1,50 +0,0 @@ -[@openmrs/esm-framework](../API.md) / NavigationContext - -# Interface: NavigationContext - -## Table of contents - -### Properties - -- [type](NavigationContext.md#type) - -### Methods - -- [handler](NavigationContext.md#handler) - -## Properties - -### type - -• **type**: [`NavigationContextType`](../API.md#navigationcontexttype) - -#### Defined in - -[packages/framework/esm-extensions/src/contexts.ts:6](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/contexts.ts#L6) - -## Methods - -### handler - -▸ **handler**<`T`\>(`link`, `state`): `boolean` - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `any` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `link` | `string` | -| `state` | `T` | - -#### Returns - -`boolean` - -#### Defined in - -[packages/framework/esm-extensions/src/contexts.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/contexts.ts#L7) diff --git a/packages/framework/esm-framework/docs/interfaces/NetworkRequestFailedEvent.md b/packages/framework/esm-framework/docs/interfaces/NetworkRequestFailedEvent.md deleted file mode 100644 index ba1f09854..000000000 --- a/packages/framework/esm-framework/docs/interfaces/NetworkRequestFailedEvent.md +++ /dev/null @@ -1,49 +0,0 @@ -[@openmrs/esm-framework](../API.md) / NetworkRequestFailedEvent - -# Interface: NetworkRequestFailedEvent - -## Hierarchy - -- [`OmrsServiceWorkerEvent`](OmrsServiceWorkerEvent.md)<``"networkRequestFailed"``\> - - ↳ **`NetworkRequestFailedEvent`** - -## Table of contents - -### Properties - -- [request](NetworkRequestFailedEvent.md#request) -- [type](NetworkRequestFailedEvent.md#type) - -## Properties - -### request - -• **request**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `body` | `string` | -| `headers` | `Record`<`string`, `string`\> | -| `method` | `string` | -| `url` | `string` | - -#### Defined in - -[packages/framework/esm-offline/src/service-worker-events.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-events.ts#L7) - -___ - -### type - -• **type**: ``"networkRequestFailed"`` - -#### Inherited from - -[OmrsServiceWorkerEvent](OmrsServiceWorkerEvent.md).[type](OmrsServiceWorkerEvent.md#type) - -#### Defined in - -[packages/framework/esm-offline/src/service-worker-events.ts:2](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-events.ts#L2) diff --git a/packages/framework/esm-framework/docs/interfaces/NotificationDescriptor.md b/packages/framework/esm-framework/docs/interfaces/NotificationDescriptor.md new file mode 100644 index 000000000..d181d059a --- /dev/null +++ b/packages/framework/esm-framework/docs/interfaces/NotificationDescriptor.md @@ -0,0 +1,74 @@ +[@openmrs/esm-framework](../API.md) / NotificationDescriptor + +# Interface: NotificationDescriptor + +## Table of contents + +### UI Properties + +- [action](NotificationDescriptor.md#action) +- [critical](NotificationDescriptor.md#critical) +- [description](NotificationDescriptor.md#description) +- [kind](NotificationDescriptor.md#kind) +- [millis](NotificationDescriptor.md#millis) +- [title](NotificationDescriptor.md#title) + +## UI Properties + +### action + +• `Optional` **action**: `ReactNode` + +#### Defined in + +[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:11](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L11) + +___ + +### critical + +• `Optional` **critical**: `boolean` + +#### Defined in + +[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:13](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L13) + +___ + +### description + +• **description**: `ReactNode` + +#### Defined in + +[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:10](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L10) + +___ + +### kind + +• `Optional` **kind**: [`InlineNotificationType`](../API.md#inlinenotificationtype) + +#### Defined in + +[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:12](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L12) + +___ + +### millis + +• `Optional` **millis**: `number` + +#### Defined in + +[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:14](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L14) + +___ + +### title + +• `Optional` **title**: `string` + +#### Defined in + +[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L15) diff --git a/packages/framework/esm-framework/docs/interfaces/OfflineModeResult.md b/packages/framework/esm-framework/docs/interfaces/OfflineModeResult.md index ec71b8fd2..82c2387b9 100644 --- a/packages/framework/esm-framework/docs/interfaces/OfflineModeResult.md +++ b/packages/framework/esm-framework/docs/interfaces/OfflineModeResult.md @@ -4,13 +4,13 @@ ## Table of contents -### Properties +### Offline Properties - [active](OfflineModeResult.md#active) - [current](OfflineModeResult.md#current) - [notAvailable](OfflineModeResult.md#notavailable) -## Properties +## Offline Properties ### active @@ -18,7 +18,7 @@ #### Defined in -[packages/framework/esm-offline/src/mode.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L41) +[packages/framework/esm-offline/src/mode.ts:43](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L43) ___ @@ -28,7 +28,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/mode.ts:39](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L39) +[packages/framework/esm-offline/src/mode.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L41) ___ @@ -38,4 +38,4 @@ ___ #### Defined in -[packages/framework/esm-offline/src/mode.ts:40](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L40) +[packages/framework/esm-offline/src/mode.ts:42](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L42) diff --git a/packages/framework/esm-framework/docs/interfaces/OfflinePatientArgs.md b/packages/framework/esm-framework/docs/interfaces/OfflinePatientArgs.md index b4479b045..092cac04f 100644 --- a/packages/framework/esm-framework/docs/interfaces/OfflinePatientArgs.md +++ b/packages/framework/esm-framework/docs/interfaces/OfflinePatientArgs.md @@ -4,12 +4,12 @@ ## Table of contents -### Properties +### Offline Properties - [patientUuid](OfflinePatientArgs.md#patientuuid) - [signal](OfflinePatientArgs.md#signal) -## Properties +## Offline Properties ### patientUuid @@ -19,7 +19,7 @@ The UUID of the patient that should be made available offline. #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:70](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L70) +[packages/framework/esm-offline/src/offline-patient-data.ts:71](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L71) ___ @@ -31,4 +31,4 @@ An {@link AbortSignal} which notifies about the cancellation of the operation. #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:74](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L74) +[packages/framework/esm-offline/src/offline-patient-data.ts:75](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L75) diff --git a/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncHandler.md b/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncHandler.md index de57a8a44..0ae03488d 100644 --- a/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncHandler.md +++ b/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncHandler.md @@ -4,7 +4,7 @@ ## Table of contents -### Properties +### Offline Properties - [displayName](OfflinePatientDataSyncHandler.md#displayname) @@ -12,7 +12,7 @@ - [onOfflinePatientAdded](OfflinePatientDataSyncHandler.md#onofflinepatientadded) -## Properties +## Offline Properties ### displayName @@ -23,7 +23,7 @@ This is ideally translated. #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:55](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L55) +[packages/framework/esm-offline/src/offline-patient-data.ts:56](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L56) ## Methods @@ -49,4 +49,4 @@ A promise which should resolve if all data could be cached and reject when there #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:63](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L63) +[packages/framework/esm-offline/src/offline-patient-data.ts:64](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L64) diff --git a/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncState.md b/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncState.md index 6a727588b..448c9a777 100644 --- a/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncState.md +++ b/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncState.md @@ -4,7 +4,7 @@ ## Table of contents -### Properties +### Offline Properties - [errors](OfflinePatientDataSyncState.md#errors) - [failedHandlers](OfflinePatientDataSyncState.md#failedhandlers) @@ -16,7 +16,7 @@ - [abort](OfflinePatientDataSyncState.md#abort) -## Properties +## Offline Properties ### errors @@ -26,7 +26,7 @@ A set of error messages associated with the identifers of the failed handlers. #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L41) +[packages/framework/esm-offline/src/offline-patient-data.ts:42](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L42) ___ @@ -39,7 +39,7 @@ patient's data. #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:37](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L37) +[packages/framework/esm-offline/src/offline-patient-data.ts:38](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L38) ___ @@ -52,7 +52,7 @@ patient's data. #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:32](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L32) +[packages/framework/esm-offline/src/offline-patient-data.ts:33](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L33) ___ @@ -65,7 +65,7 @@ of synchronizing the patient's data. #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:27](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L27) +[packages/framework/esm-offline/src/offline-patient-data.ts:28](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L28) ___ @@ -77,7 +77,7 @@ The time when this state snapshot was initially created. #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:22](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L22) +[packages/framework/esm-offline/src/offline-patient-data.ts:23](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L23) ## Methods @@ -96,4 +96,4 @@ Aborts the process of downloading data. #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:47](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L47) +[packages/framework/esm-offline/src/offline-patient-data.ts:48](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L48) diff --git a/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncStore.md b/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncStore.md index f6f754aa1..78f0da1d2 100644 --- a/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncStore.md +++ b/packages/framework/esm-framework/docs/interfaces/OfflinePatientDataSyncStore.md @@ -4,12 +4,12 @@ ## Table of contents -### Properties +### Offline Properties - [handlers](OfflinePatientDataSyncStore.md#handlers) - [offlinePatientDataSyncState](OfflinePatientDataSyncStore.md#offlinepatientdatasyncstate) -## Properties +## Offline Properties ### handlers @@ -21,7 +21,7 @@ the handler registration. #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L15) +[packages/framework/esm-offline/src/offline-patient-data.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L16) ___ @@ -34,4 +34,4 @@ the current data synchronizaton state. #### Defined in -[packages/framework/esm-offline/src/offline-patient-data.ts:9](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L9) +[packages/framework/esm-offline/src/offline-patient-data.ts:10](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L10) diff --git a/packages/framework/esm-framework/docs/interfaces/OfflineSynchronizationStore.md b/packages/framework/esm-framework/docs/interfaces/OfflineSynchronizationStore.md deleted file mode 100644 index 771d07371..000000000 --- a/packages/framework/esm-framework/docs/interfaces/OfflineSynchronizationStore.md +++ /dev/null @@ -1,30 +0,0 @@ -[@openmrs/esm-framework](../API.md) / OfflineSynchronizationStore - -# Interface: OfflineSynchronizationStore - -Represents the data inside the global offline synchronization store. -Provides information about a currently ongoing synchronization. - -## Table of contents - -### Properties - -- [synchronization](OfflineSynchronizationStore.md#synchronization) - -## Properties - -### synchronization - -• `Optional` **synchronization**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `abortController` | `AbortController` | -| `pendingCount` | `number` | -| `totalCount` | `number` | - -#### Defined in - -[packages/framework/esm-offline/src/sync.ts:93](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L93) diff --git a/packages/framework/esm-framework/docs/interfaces/OmrsServiceWorkerEvent.md b/packages/framework/esm-framework/docs/interfaces/OmrsServiceWorkerEvent.md deleted file mode 100644 index f38b4528e..000000000 --- a/packages/framework/esm-framework/docs/interfaces/OmrsServiceWorkerEvent.md +++ /dev/null @@ -1,31 +0,0 @@ -[@openmrs/esm-framework](../API.md) / OmrsServiceWorkerEvent - -# Interface: OmrsServiceWorkerEvent - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `TypeIdentifier` | extends `string` | - -## Hierarchy - -- **`OmrsServiceWorkerEvent`** - - ↳ [`NetworkRequestFailedEvent`](NetworkRequestFailedEvent.md) - -## Table of contents - -### Properties - -- [type](OmrsServiceWorkerEvent.md#type) - -## Properties - -### type - -• **type**: `TypeIdentifier` - -#### Defined in - -[packages/framework/esm-offline/src/service-worker-events.ts:2](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-events.ts#L2) diff --git a/packages/framework/esm-framework/docs/interfaces/OmrsServiceWorkerMessage.md b/packages/framework/esm-framework/docs/interfaces/OmrsServiceWorkerMessage.md index 13166fd0c..f9b68a11b 100644 --- a/packages/framework/esm-framework/docs/interfaces/OmrsServiceWorkerMessage.md +++ b/packages/framework/esm-framework/docs/interfaces/OmrsServiceWorkerMessage.md @@ -20,11 +20,11 @@ ## Table of contents -### Properties +### Offline Properties - [type](OmrsServiceWorkerMessage.md#type) -## Properties +## Offline Properties ### type @@ -32,4 +32,4 @@ #### Defined in -[packages/framework/esm-offline/src/service-worker-messaging.ts:27](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L27) +[packages/framework/esm-offline/src/service-worker-messaging.ts:28](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L28) diff --git a/packages/framework/esm-framework/docs/interfaces/OnImportMapChangedMessage.md b/packages/framework/esm-framework/docs/interfaces/OnImportMapChangedMessage.md index df48bb2fb..7ad567b0a 100644 --- a/packages/framework/esm-framework/docs/interfaces/OnImportMapChangedMessage.md +++ b/packages/framework/esm-framework/docs/interfaces/OnImportMapChangedMessage.md @@ -10,12 +10,12 @@ ## Table of contents -### Properties +### Offline Properties - [importMap](OnImportMapChangedMessage.md#importmap) - [type](OnImportMapChangedMessage.md#type) -## Properties +## Offline Properties ### importMap @@ -23,7 +23,7 @@ #### Defined in -[packages/framework/esm-offline/src/service-worker-messaging.ts:32](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L32) +[packages/framework/esm-offline/src/service-worker-messaging.ts:33](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L33) ___ @@ -37,4 +37,4 @@ ___ #### Defined in -[packages/framework/esm-offline/src/service-worker-messaging.ts:27](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L27) +[packages/framework/esm-offline/src/service-worker-messaging.ts:28](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L28) diff --git a/packages/framework/esm-framework/docs/interfaces/OnlyThePatient.md b/packages/framework/esm-framework/docs/interfaces/OnlyThePatient.md index 72bf1dc06..f5f9160fa 100644 --- a/packages/framework/esm-framework/docs/interfaces/OnlyThePatient.md +++ b/packages/framework/esm-framework/docs/interfaces/OnlyThePatient.md @@ -26,4 +26,4 @@ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-patient.ts#L20) +[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-patient.ts#L16) diff --git a/packages/framework/esm-framework/docs/interfaces/OpenmrsReactComponentProps.md b/packages/framework/esm-framework/docs/interfaces/OpenmrsReactComponentProps.md deleted file mode 100644 index 49fe26990..000000000 --- a/packages/framework/esm-framework/docs/interfaces/OpenmrsReactComponentProps.md +++ /dev/null @@ -1,19 +0,0 @@ -[@openmrs/esm-framework](../API.md) / OpenmrsReactComponentProps - -# Interface: OpenmrsReactComponentProps - -## Table of contents - -### Properties - -- [\_extensionContext](OpenmrsReactComponentProps.md#_extensioncontext) - -## Properties - -### \_extensionContext - -• `Optional` **\_extensionContext**: [`ExtensionData`](ExtensionData.md) - -#### Defined in - -[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:62](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L62) diff --git a/packages/framework/esm-framework/docs/interfaces/OpenmrsReactComponentState.md b/packages/framework/esm-framework/docs/interfaces/OpenmrsReactComponentState.md deleted file mode 100644 index b5bea2c1c..000000000 --- a/packages/framework/esm-framework/docs/interfaces/OpenmrsReactComponentState.md +++ /dev/null @@ -1,41 +0,0 @@ -[@openmrs/esm-framework](../API.md) / OpenmrsReactComponentState - -# Interface: OpenmrsReactComponentState - -## Table of contents - -### Properties - -- [caughtError](OpenmrsReactComponentState.md#caughterror) -- [caughtErrorInfo](OpenmrsReactComponentState.md#caughterrorinfo) -- [config](OpenmrsReactComponentState.md#config) - -## Properties - -### caughtError - -• **caughtError**: `any` - -#### Defined in - -[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:66](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L66) - -___ - -### caughtErrorInfo - -• **caughtErrorInfo**: `any` - -#### Defined in - -[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:67](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L67) - -___ - -### config - -• **config**: [`ComponentConfig`](ComponentConfig.md) - -#### Defined in - -[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:68](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L68) diff --git a/packages/framework/esm-framework/docs/interfaces/PatientWithFullResponse.md b/packages/framework/esm-framework/docs/interfaces/PatientWithFullResponse.md index 5cc34aea1..9d3da83c6 100644 --- a/packages/framework/esm-framework/docs/interfaces/PatientWithFullResponse.md +++ b/packages/framework/esm-framework/docs/interfaces/PatientWithFullResponse.md @@ -26,4 +26,4 @@ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-patient.ts#L16) +[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:12](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-patient.ts#L12) diff --git a/packages/framework/esm-framework/docs/interfaces/QueueItemDescriptor.md b/packages/framework/esm-framework/docs/interfaces/QueueItemDescriptor.md index 6fcb6520d..3ec694783 100644 --- a/packages/framework/esm-framework/docs/interfaces/QueueItemDescriptor.md +++ b/packages/framework/esm-framework/docs/interfaces/QueueItemDescriptor.md @@ -9,14 +9,14 @@ locations to better represent the sync item, e.g. in the UI. ## Table of contents -### Properties +### Offline Properties - [dependencies](QueueItemDescriptor.md#dependencies) - [displayName](QueueItemDescriptor.md#displayname) - [id](QueueItemDescriptor.md#id) - [patientUuid](QueueItemDescriptor.md#patientuuid) -## Properties +## Offline Properties ### dependencies @@ -24,7 +24,7 @@ locations to better represent the sync item, e.g. in the UI. #### Defined in -[packages/framework/esm-offline/src/sync.ts:31](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L31) +[packages/framework/esm-offline/src/sync.ts:32](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L32) ___ @@ -34,7 +34,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:36](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L36) +[packages/framework/esm-offline/src/sync.ts:37](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L37) ___ @@ -44,7 +44,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:30](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L30) +[packages/framework/esm-offline/src/sync.ts:31](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L31) ___ @@ -54,4 +54,4 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:35](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L35) +[packages/framework/esm-offline/src/sync.ts:36](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L36) diff --git a/packages/framework/esm-framework/docs/interfaces/RegisterDynamicRouteMessage.md b/packages/framework/esm-framework/docs/interfaces/RegisterDynamicRouteMessage.md index cd7d86b47..1be8c7e90 100644 --- a/packages/framework/esm-framework/docs/interfaces/RegisterDynamicRouteMessage.md +++ b/packages/framework/esm-framework/docs/interfaces/RegisterDynamicRouteMessage.md @@ -10,14 +10,14 @@ ## Table of contents -### Properties +### Offline Properties - [pattern](RegisterDynamicRouteMessage.md#pattern) - [strategy](RegisterDynamicRouteMessage.md#strategy) - [type](RegisterDynamicRouteMessage.md#type) - [url](RegisterDynamicRouteMessage.md#url) -## Properties +## Offline Properties ### pattern @@ -25,7 +25,7 @@ #### Defined in -[packages/framework/esm-offline/src/service-worker-messaging.ts:40](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L40) +[packages/framework/esm-offline/src/service-worker-messaging.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L41) ___ @@ -35,7 +35,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/service-worker-messaging.ts:42](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L42) +[packages/framework/esm-offline/src/service-worker-messaging.ts:43](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L43) ___ @@ -49,7 +49,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/service-worker-messaging.ts:27](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L27) +[packages/framework/esm-offline/src/service-worker-messaging.ts:28](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L28) ___ @@ -59,4 +59,4 @@ ___ #### Defined in -[packages/framework/esm-offline/src/service-worker-messaging.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L41) +[packages/framework/esm-offline/src/service-worker-messaging.ts:42](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L42) diff --git a/packages/framework/esm-framework/docs/interfaces/RetryOptions.md b/packages/framework/esm-framework/docs/interfaces/RetryOptions.md index 42d052825..00ca5a25f 100644 --- a/packages/framework/esm-framework/docs/interfaces/RetryOptions.md +++ b/packages/framework/esm-framework/docs/interfaces/RetryOptions.md @@ -33,7 +33,7 @@ Returning a value for the inital attempt (`0`) delays the initial function invoc #### Defined in -[packages/framework/esm-utils/src/retry.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/retry.ts#L16) +[packages/framework/esm-utils/src/retry.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/retry.ts#L18) ___ @@ -57,7 +57,7 @@ Allows running side-effects on errors, e.g. logging. #### Defined in -[packages/framework/esm-utils/src/retry.ts:23](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/retry.ts#L23) +[packages/framework/esm-utils/src/retry.ts:25](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/retry.ts#L25) ___ @@ -80,4 +80,4 @@ with an error on the current attempt. #### Defined in -[packages/framework/esm-utils/src/retry.ts:10](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/retry.ts#L10) +[packages/framework/esm-utils/src/retry.ts:12](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/retry.ts#L12) diff --git a/packages/framework/esm-framework/docs/interfaces/ShowNotificationEvent.md b/packages/framework/esm-framework/docs/interfaces/ShowNotificationEvent.md index e21e99ee4..9d15cac94 100644 --- a/packages/framework/esm-framework/docs/interfaces/ShowNotificationEvent.md +++ b/packages/framework/esm-framework/docs/interfaces/ShowNotificationEvent.md @@ -20,7 +20,7 @@ #### Defined in -[packages/framework/esm-globals/src/events.ts:61](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L61) +[packages/framework/esm-globals/src/events.ts:65](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L65) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/framework/esm-globals/src/events.ts:52](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L52) +[packages/framework/esm-globals/src/events.ts:56](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L56) ___ @@ -40,7 +40,7 @@ ___ #### Defined in -[packages/framework/esm-globals/src/events.ts:53](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L53) +[packages/framework/esm-globals/src/events.ts:57](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L57) ___ @@ -50,7 +50,7 @@ ___ #### Defined in -[packages/framework/esm-globals/src/events.ts:62](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L62) +[packages/framework/esm-globals/src/events.ts:66](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L66) ___ @@ -60,4 +60,4 @@ ___ #### Defined in -[packages/framework/esm-globals/src/events.ts:60](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L60) +[packages/framework/esm-globals/src/events.ts:64](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L64) diff --git a/packages/framework/esm-framework/docs/interfaces/ShowToastEvent.md b/packages/framework/esm-framework/docs/interfaces/ShowToastEvent.md index 806ed6284..3d63e9594 100644 --- a/packages/framework/esm-framework/docs/interfaces/ShowToastEvent.md +++ b/packages/framework/esm-framework/docs/interfaces/ShowToastEvent.md @@ -19,7 +19,7 @@ #### Defined in -[packages/framework/esm-globals/src/events.ts:66](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L66) +[packages/framework/esm-globals/src/events.ts:71](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L71) ___ @@ -29,7 +29,7 @@ ___ #### Defined in -[packages/framework/esm-globals/src/events.ts:67](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L67) +[packages/framework/esm-globals/src/events.ts:72](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L72) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[packages/framework/esm-globals/src/events.ts:75](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L75) +[packages/framework/esm-globals/src/events.ts:80](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L80) ___ @@ -49,4 +49,4 @@ ___ #### Defined in -[packages/framework/esm-globals/src/events.ts:74](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L74) +[packages/framework/esm-globals/src/events.ts:79](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L79) diff --git a/packages/framework/esm-framework/docs/interfaces/SyncItem.md b/packages/framework/esm-framework/docs/interfaces/SyncItem.md index b758b8b29..45a57ea18 100644 --- a/packages/framework/esm-framework/docs/interfaces/SyncItem.md +++ b/packages/framework/esm-framework/docs/interfaces/SyncItem.md @@ -14,7 +14,7 @@ actual data to be synchronized (i.e. the item's `content`). ## Table of contents -### Properties +### Offline Properties - [content](SyncItem.md#content) - [createdOn](SyncItem.md#createdon) @@ -24,7 +24,7 @@ actual data to be synchronized (i.e. the item's `content`). - [type](SyncItem.md#type) - [userId](SyncItem.md#userid) -## Properties +## Offline Properties ### content @@ -32,7 +32,7 @@ actual data to be synchronized (i.e. the item's `content`). #### Defined in -[packages/framework/esm-offline/src/sync.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L14) +[packages/framework/esm-offline/src/sync.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L15) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L15) +[packages/framework/esm-offline/src/sync.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L16) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L16) +[packages/framework/esm-offline/src/sync.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L17) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:11](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L11) +[packages/framework/esm-offline/src/sync.ts:12](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L12) ___ @@ -79,7 +79,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L17) +[packages/framework/esm-offline/src/sync.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L18) ___ @@ -89,7 +89,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:13](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L13) +[packages/framework/esm-offline/src/sync.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L14) ___ @@ -99,4 +99,4 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:12](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L12) +[packages/framework/esm-offline/src/sync.ts:13](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L13) diff --git a/packages/framework/esm-framework/docs/interfaces/SyncProcessOptions.md b/packages/framework/esm-framework/docs/interfaces/SyncProcessOptions.md index 133969dbc..cd9a4e37a 100644 --- a/packages/framework/esm-framework/docs/interfaces/SyncProcessOptions.md +++ b/packages/framework/esm-framework/docs/interfaces/SyncProcessOptions.md @@ -2,7 +2,7 @@ # Interface: SyncProcessOptions -Additional data which can be used for synchronizing data in a [ProcessSyncItem](../API.md#processsyncitem) function. +Additional data which can be used for synchronizing data in a {@link ProcessSyncItem} function. ## Type parameters @@ -12,7 +12,7 @@ Additional data which can be used for synchronizing data in a [ProcessSyncItem]( ## Table of contents -### Properties +### Offline Properties - [abort](SyncProcessOptions.md#abort) - [dependencies](SyncProcessOptions.md#dependencies) @@ -20,7 +20,7 @@ Additional data which can be used for synchronizing data in a [ProcessSyncItem]( - [items](SyncProcessOptions.md#items) - [userId](SyncProcessOptions.md#userid) -## Properties +## Offline Properties ### abort @@ -28,7 +28,7 @@ Additional data which can be used for synchronizing data in a [ProcessSyncItem]( #### Defined in -[packages/framework/esm-offline/src/sync.ts:54](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L54) +[packages/framework/esm-offline/src/sync.ts:55](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L55) ___ @@ -38,7 +38,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:58](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L58) +[packages/framework/esm-offline/src/sync.ts:59](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L59) ___ @@ -48,7 +48,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:56](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L56) +[packages/framework/esm-offline/src/sync.ts:57](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L57) ___ @@ -58,7 +58,7 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:57](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L57) +[packages/framework/esm-offline/src/sync.ts:58](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L58) ___ @@ -68,4 +68,4 @@ ___ #### Defined in -[packages/framework/esm-offline/src/sync.ts:55](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L55) +[packages/framework/esm-offline/src/sync.ts:56](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L56) diff --git a/packages/framework/esm-framework/docs/interfaces/ToastDescriptor.md b/packages/framework/esm-framework/docs/interfaces/ToastDescriptor.md new file mode 100644 index 000000000..f400ce554 --- /dev/null +++ b/packages/framework/esm-framework/docs/interfaces/ToastDescriptor.md @@ -0,0 +1,69 @@ +[@openmrs/esm-framework](../API.md) / ToastDescriptor + +# Interface: ToastDescriptor + +## Hierarchy + +- **`ToastDescriptor`** + + ↳ [`ToastNotificationMeta`](ToastNotificationMeta.md) + +## Table of contents + +### UI Properties + +- [critical](ToastDescriptor.md#critical) +- [description](ToastDescriptor.md#description) +- [kind](ToastDescriptor.md#kind) +- [millis](ToastDescriptor.md#millis) +- [title](ToastDescriptor.md#title) + +## UI Properties + +### critical + +• `Optional` **critical**: `boolean` + +#### Defined in + +[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L17) + +___ + +### description + +• **description**: `ReactNode` + +#### Defined in + +[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L15) + +___ + +### kind + +• `Optional` **kind**: [`ToastType`](../API.md#toasttype) + +#### Defined in + +[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L16) + +___ + +### millis + +• `Optional` **millis**: `number` + +#### Defined in + +[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L19) + +___ + +### title + +• `Optional` **title**: `string` + +#### Defined in + +[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L18) diff --git a/packages/framework/esm-framework/docs/interfaces/ToastNotificationMeta.md b/packages/framework/esm-framework/docs/interfaces/ToastNotificationMeta.md new file mode 100644 index 000000000..8e7ba6f0c --- /dev/null +++ b/packages/framework/esm-framework/docs/interfaces/ToastNotificationMeta.md @@ -0,0 +1,100 @@ +[@openmrs/esm-framework](../API.md) / ToastNotificationMeta + +# Interface: ToastNotificationMeta + +## Hierarchy + +- [`ToastDescriptor`](ToastDescriptor.md) + + ↳ **`ToastNotificationMeta`** + +## Table of contents + +### UI Properties + +- [critical](ToastNotificationMeta.md#critical) +- [description](ToastNotificationMeta.md#description) +- [id](ToastNotificationMeta.md#id) +- [kind](ToastNotificationMeta.md#kind) +- [millis](ToastNotificationMeta.md#millis) +- [title](ToastNotificationMeta.md#title) + +## UI Properties + +### critical + +• `Optional` **critical**: `boolean` + +#### Inherited from + +[ToastDescriptor](ToastDescriptor.md).[critical](ToastDescriptor.md#critical) + +#### Defined in + +[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L17) + +___ + +### description + +• **description**: `ReactNode` + +#### Inherited from + +[ToastDescriptor](ToastDescriptor.md).[description](ToastDescriptor.md#description) + +#### Defined in + +[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L15) + +___ + +### id + +• **id**: `number` + +#### Defined in + +[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:23](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L23) + +___ + +### kind + +• `Optional` **kind**: [`ToastType`](../API.md#toasttype) + +#### Inherited from + +[ToastDescriptor](ToastDescriptor.md).[kind](ToastDescriptor.md#kind) + +#### Defined in + +[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L16) + +___ + +### millis + +• `Optional` **millis**: `number` + +#### Inherited from + +[ToastDescriptor](ToastDescriptor.md).[millis](ToastDescriptor.md#millis) + +#### Defined in + +[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L19) + +___ + +### title + +• `Optional` **title**: `string` + +#### Inherited from + +[ToastDescriptor](ToastDescriptor.md).[title](ToastDescriptor.md#title) + +#### Defined in + +[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L18) diff --git a/packages/framework/esm-framework/docs/interfaces/UserHasAccessProps.md b/packages/framework/esm-framework/docs/interfaces/UserHasAccessProps.md index 2b9f25bbf..24a3d3f4d 100644 --- a/packages/framework/esm-framework/docs/interfaces/UserHasAccessProps.md +++ b/packages/framework/esm-framework/docs/interfaces/UserHasAccessProps.md @@ -4,11 +4,11 @@ ## Table of contents -### Properties +### API Properties - [privilege](UserHasAccessProps.md#privilege) -## Properties +## API Properties ### privilege @@ -16,4 +16,4 @@ #### Defined in -[packages/framework/esm-react-utils/src/UserHasAccess.tsx:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/UserHasAccess.tsx#L5) +[packages/framework/esm-react-utils/src/UserHasAccess.tsx:6](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/UserHasAccess.tsx#L6) diff --git a/packages/framework/esm-framework/docs/interfaces/VisitItem.md b/packages/framework/esm-framework/docs/interfaces/VisitItem.md index 7006e8bc4..9578e7b58 100644 --- a/packages/framework/esm-framework/docs/interfaces/VisitItem.md +++ b/packages/framework/esm-framework/docs/interfaces/VisitItem.md @@ -19,7 +19,7 @@ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:84](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L84) +[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:80](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L80) ___ @@ -29,7 +29,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:81](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L81) +[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) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:83](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L83) +[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:79](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L79) ___ @@ -49,4 +49,4 @@ ___ #### Defined in -[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:82](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L82) +[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:78](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L78) diff --git a/packages/framework/esm-framework/src/index.ts b/packages/framework/esm-framework/src/index.ts index 62e9a9357..2a73cc340 100644 --- a/packages/framework/esm-framework/src/index.ts +++ b/packages/framework/esm-framework/src/index.ts @@ -1,11 +1,11 @@ -export * from "@openmrs/esm-api"; +export * from "@openmrs/esm-api/src/public"; export * from "@openmrs/esm-breadcrumbs"; -export * from "@openmrs/esm-config"; +export * from "@openmrs/esm-config/src/public"; export * from "@openmrs/esm-error-handling"; -export * from "@openmrs/esm-extensions"; -export * from "@openmrs/esm-globals"; -export * from "@openmrs/esm-react-utils"; -export * from "@openmrs/esm-state"; -export * from "@openmrs/esm-styleguide"; +export * from "@openmrs/esm-extensions/src/public"; +export * from "@openmrs/esm-globals/src/public"; +export * from "@openmrs/esm-offline/src/public"; +export * from "@openmrs/esm-react-utils/src/public"; +export * from "@openmrs/esm-state/src/public"; +export * from "@openmrs/esm-styleguide/src/public"; export * from "@openmrs/esm-utils"; -export * from "@openmrs/esm-offline"; diff --git a/packages/framework/esm-framework/src/internal.ts b/packages/framework/esm-framework/src/internal.ts new file mode 100644 index 000000000..73b3fa88e --- /dev/null +++ b/packages/framework/esm-framework/src/internal.ts @@ -0,0 +1,11 @@ +export * from "@openmrs/esm-api"; +export * from "@openmrs/esm-breadcrumbs"; +export * from "@openmrs/esm-config"; +export * from "@openmrs/esm-error-handling"; +export * from "@openmrs/esm-extensions"; +export * from "@openmrs/esm-globals"; +export * from "@openmrs/esm-offline"; +export * from "@openmrs/esm-react-utils"; +export * from "@openmrs/esm-state"; +export * from "@openmrs/esm-styleguide"; +export * from "@openmrs/esm-utils"; diff --git a/packages/framework/esm-globals/src/events.ts b/packages/framework/esm-globals/src/events.ts index 7438770c8..b93d3b524 100644 --- a/packages/framework/esm-globals/src/events.ts +++ b/packages/framework/esm-globals/src/events.ts @@ -10,6 +10,7 @@ export function dispatchConnectivityChanged(online: boolean) { ); } +/** @category Offline */ export function subscribeConnectivityChanged( cb: (ev: ConnectivityChangedEvent) => void ) { @@ -19,6 +20,7 @@ export function subscribeConnectivityChanged( window.removeEventListener(connectivityChangedEventName, handler); } +/** @category Offline */ export function subscribeConnectivity( cb: (ev: ConnectivityChangedEvent) => void ) { @@ -39,6 +41,7 @@ export function dispatchPrecacheStaticDependencies( ); } +/** @category Offline */ export function subscribePrecacheStaticDependencies( cb: (data: PrecacheStaticDependenciesEvent) => void ) { @@ -48,6 +51,7 @@ export function subscribePrecacheStaticDependencies( window.removeEventListener(precacheStaticDependenciesEventName, handler); } +/** @category UI */ export interface ShowNotificationEvent { description: any; kind?: @@ -62,6 +66,7 @@ export interface ShowNotificationEvent { millis?: number; } +/** @category UI */ export interface ShowToastEvent { description: any; kind?: @@ -84,6 +89,7 @@ export function dispatchNotificationShown(data: ShowNotificationEvent) { ); } +/** @category UI */ export function subscribeNotificationShown( cb: (data: ShowNotificationEvent) => void ) { @@ -92,6 +98,7 @@ export function subscribeNotificationShown( return () => window.removeEventListener(notificationShownName, handler); } +/** @category UI */ export function subscribeToastShown(cb: (data: ShowToastEvent) => void) { const handler = (ev: CustomEvent) => cb(ev.detail); window.addEventListener(toastShownName, handler); diff --git a/packages/framework/esm-globals/src/public.ts b/packages/framework/esm-globals/src/public.ts new file mode 100644 index 000000000..3fab49fac --- /dev/null +++ b/packages/framework/esm-globals/src/public.ts @@ -0,0 +1,12 @@ +export { + ConnectivityChangedEvent, + subscribeConnectivity, + subscribeConnectivityChanged, + subscribePrecacheStaticDependencies, + PrecacheStaticDependenciesEvent, + subscribeNotificationShown, + subscribeToastShown, + ShowNotificationEvent, + ShowToastEvent, +} from "./events"; +export * from "./types"; diff --git a/packages/framework/esm-offline/src/mode.ts b/packages/framework/esm-offline/src/mode.ts index 6d6e5ba53..8839af46a 100644 --- a/packages/framework/esm-offline/src/mode.ts +++ b/packages/framework/esm-offline/src/mode.ts @@ -1,3 +1,5 @@ +/** @module @category Offline */ + async function isSafariPrivateBrowsing() { const storage = window.sessionStorage; diff --git a/packages/framework/esm-offline/src/offline-patient-data.ts b/packages/framework/esm-offline/src/offline-patient-data.ts index a4f7280d0..de519c09f 100644 --- a/packages/framework/esm-offline/src/offline-patient-data.ts +++ b/packages/framework/esm-offline/src/offline-patient-data.ts @@ -1,3 +1,4 @@ +/** @module @category Offline */ import Dexie, { Table } from "dexie"; import { createGlobalStore } from "@openmrs/esm-state"; diff --git a/packages/framework/esm-offline/src/public.ts b/packages/framework/esm-offline/src/public.ts new file mode 100644 index 000000000..08bc3478a --- /dev/null +++ b/packages/framework/esm-offline/src/public.ts @@ -0,0 +1,18 @@ +export { OfflineMode, OfflineModeResult, getCurrentOfflineMode } from "./mode"; +export * from "./offline-patient-data"; +export * from "./service-worker-messaging"; +export * from "./service-worker-http-headers"; +export * from "./uuid"; +export { + QueueItemDescriptor, + SyncItem, + SyncProcessOptions, + queueSynchronizationItem, + getSynchronizationItem, + getSynchronizationItems, + getOfflineDb, + canBeginEditSynchronizationItemsOfType, + beginEditSynchronizationItem, + deleteSynchronizationItem, + setupOfflineSync, +} from "./sync"; diff --git a/packages/framework/esm-offline/src/service-worker-http-headers.ts b/packages/framework/esm-offline/src/service-worker-http-headers.ts index 2e11a98ce..43101b4f6 100644 --- a/packages/framework/esm-offline/src/service-worker-http-headers.ts +++ b/packages/framework/esm-offline/src/service-worker-http-headers.ts @@ -1,3 +1,5 @@ +/** @module @category Offline */ + export const omrsOfflineResponseBodyHttpHeaderName = "x-omrs-offline-response-body"; export const omrsOfflineResponseStatusHttpHeaderName = diff --git a/packages/framework/esm-offline/src/service-worker-messaging.ts b/packages/framework/esm-offline/src/service-worker-messaging.ts index 31e9cfce7..6f8975ca9 100644 --- a/packages/framework/esm-offline/src/service-worker-messaging.ts +++ b/packages/framework/esm-offline/src/service-worker-messaging.ts @@ -1,3 +1,4 @@ +/** @module @category Offline */ import type { ImportMap } from "@openmrs/esm-globals"; import { OmrsOfflineCachingStrategy } from "./service-worker-http-headers"; import { getOmrsServiceWorker } from "./service-worker"; diff --git a/packages/framework/esm-offline/src/sync.ts b/packages/framework/esm-offline/src/sync.ts index 11f398c72..874e945c5 100644 --- a/packages/framework/esm-offline/src/sync.ts +++ b/packages/framework/esm-offline/src/sync.ts @@ -1,3 +1,4 @@ +/** @module @category Offline */ import Dexie, { Table } from "dexie"; import { getLoggedInUser } from "@openmrs/esm-api"; import { createGlobalStore } from "@openmrs/esm-state"; diff --git a/packages/framework/esm-offline/src/uuid.ts b/packages/framework/esm-offline/src/uuid.ts index f8e506ad3..c0fbf9d0a 100644 --- a/packages/framework/esm-offline/src/uuid.ts +++ b/packages/framework/esm-offline/src/uuid.ts @@ -1,3 +1,4 @@ +/** @module @category Offline */ import { v4 } from "uuid"; export const offlineUuidPrefix = "OFFLINE+"; diff --git a/packages/framework/esm-react-utils/src/ConfigurableLink.tsx b/packages/framework/esm-react-utils/src/ConfigurableLink.tsx index 9718ffe15..3217619f7 100644 --- a/packages/framework/esm-react-utils/src/ConfigurableLink.tsx +++ b/packages/framework/esm-react-utils/src/ConfigurableLink.tsx @@ -1,3 +1,4 @@ +/** @module @category Navigation */ import React, { MouseEvent, AnchorHTMLAttributes } from "react"; import { navigate, interpolateUrl } from "@openmrs/esm-config"; @@ -27,7 +28,6 @@ export interface ConfigurableLinkProps * @param to The target path or URL. Supports interpolation. See [[navigate]] * @param children Inline elements within the link * @param otherProps Any other valid props for an tag except `href` and `onClick` - * @category Navigation */ export const ConfigurableLink: React.FC = ({ to, diff --git a/packages/framework/esm-react-utils/src/UserHasAccess.tsx b/packages/framework/esm-react-utils/src/UserHasAccess.tsx index 6a002e6bd..2de7d8809 100644 --- a/packages/framework/esm-react-utils/src/UserHasAccess.tsx +++ b/packages/framework/esm-react-utils/src/UserHasAccess.tsx @@ -1,3 +1,4 @@ +/** @module @category API */ import React, { useEffect, useState } from "react"; import { getCurrentUser, userHasAccess, LoggedInUser } from "@openmrs/esm-api"; diff --git a/packages/framework/esm-react-utils/src/createUseStore.ts b/packages/framework/esm-react-utils/src/createUseStore.ts index ee3eba8df..de8962f1a 100644 --- a/packages/framework/esm-react-utils/src/createUseStore.ts +++ b/packages/framework/esm-react-utils/src/createUseStore.ts @@ -1,3 +1,4 @@ +/** @module @category Store */ import { useEffect, useMemo, useState } from "react"; import { Store, BoundAction } from "unistore"; diff --git a/packages/framework/esm-react-utils/src/getLifecycle.ts b/packages/framework/esm-react-utils/src/getLifecycle.ts index 602bb41cd..9257ec141 100644 --- a/packages/framework/esm-react-utils/src/getLifecycle.ts +++ b/packages/framework/esm-react-utils/src/getLifecycle.ts @@ -1,3 +1,4 @@ +/** @module @category Framework */ import React from "react"; import ReactDOM from "react-dom"; import singleSpaReact from "single-spa-react"; diff --git a/packages/framework/esm-react-utils/src/public.ts b/packages/framework/esm-react-utils/src/public.ts new file mode 100644 index 000000000..da89c1948 --- /dev/null +++ b/packages/framework/esm-react-utils/src/public.ts @@ -0,0 +1,26 @@ +export { ExtensionData } from "./ComponentContext"; +export * from "./ConfigurableLink"; +export * from "./createUseStore"; +export * from "./Extension"; +export * from "./ExtensionSlot"; +export * from "./getLifecycle"; +export * from "./useAssignedExtensions"; +export * from "./useAssignedExtensionIds"; +export * from "./useBodyScrollLock"; +export * from "./useConfig"; +export * from "./useConnectedExtensions"; +export * from "./useConnectivity"; +export * from "./usePatient"; +export * from "./useCurrentPatient"; +export * from "./useExtensionSlot"; +export * from "./useExtensionSlotMeta"; +export * from "./useExtensionStore"; +export * from "./useLayoutType"; +export * from "./useLocations"; +export * from "./useOnClickOutside"; +export * from "./UserHasAccess"; +export * from "./useSessionUser"; +export * from "./useStore"; +export * from "./useVisit"; +export * from "./useVisitTypes"; +export * from "./usePagination"; diff --git a/packages/framework/esm-react-utils/src/useAssignedExtensionIds.ts b/packages/framework/esm-react-utils/src/useAssignedExtensionIds.ts index b92e25c1e..121ccb989 100644 --- a/packages/framework/esm-react-utils/src/useAssignedExtensionIds.ts +++ b/packages/framework/esm-react-utils/src/useAssignedExtensionIds.ts @@ -1,3 +1,4 @@ +/** @module @category Extension */ import { useEffect, useState } from "react"; import { getExtensionStore } from "@openmrs/esm-extensions"; import { isEqual } from "lodash"; diff --git a/packages/framework/esm-react-utils/src/useAssignedExtensions.ts b/packages/framework/esm-react-utils/src/useAssignedExtensions.ts index 431cdbafb..14353df44 100644 --- a/packages/framework/esm-react-utils/src/useAssignedExtensions.ts +++ b/packages/framework/esm-react-utils/src/useAssignedExtensions.ts @@ -1,3 +1,4 @@ +/** @module @category Extension */ import { useEffect, useState } from "react"; import { AssignedExtension, diff --git a/packages/framework/esm-react-utils/src/useBodyScrollLock.ts b/packages/framework/esm-react-utils/src/useBodyScrollLock.ts index 903c30c86..3e5d122e5 100644 --- a/packages/framework/esm-react-utils/src/useBodyScrollLock.ts +++ b/packages/framework/esm-react-utils/src/useBodyScrollLock.ts @@ -1,3 +1,4 @@ +/** @module @category UI */ import { useEffect } from "react"; export function useBodyScrollLock(active: boolean) { diff --git a/packages/framework/esm-react-utils/src/useConfig.ts b/packages/framework/esm-react-utils/src/useConfig.ts index d4fbff8dc..840c556c9 100644 --- a/packages/framework/esm-react-utils/src/useConfig.ts +++ b/packages/framework/esm-react-utils/src/useConfig.ts @@ -1,3 +1,4 @@ +/** @module @category Config */ import { useContext, useEffect, useMemo, useState } from "react"; import { getConfigStore, diff --git a/packages/framework/esm-react-utils/src/useConnectedExtensions.ts b/packages/framework/esm-react-utils/src/useConnectedExtensions.ts index b4d61bbf7..abd260fbe 100644 --- a/packages/framework/esm-react-utils/src/useConnectedExtensions.ts +++ b/packages/framework/esm-react-utils/src/useConnectedExtensions.ts @@ -1,3 +1,4 @@ +/** @module @category Extension */ import { useMemo } from "react"; import { ConnectedExtension, diff --git a/packages/framework/esm-react-utils/src/useConnectivity.ts b/packages/framework/esm-react-utils/src/useConnectivity.ts index 7447763d5..f6f22f8c1 100644 --- a/packages/framework/esm-react-utils/src/useConnectivity.ts +++ b/packages/framework/esm-react-utils/src/useConnectivity.ts @@ -1,3 +1,4 @@ +/** @module @category Offline */ import { subscribeConnectivityChanged } from "@openmrs/esm-globals"; import { useEffect, useState } from "react"; diff --git a/packages/framework/esm-react-utils/src/useCurrentPatient.ts b/packages/framework/esm-react-utils/src/useCurrentPatient.ts index 7a67fab9d..be8976c17 100644 --- a/packages/framework/esm-react-utils/src/useCurrentPatient.ts +++ b/packages/framework/esm-react-utils/src/useCurrentPatient.ts @@ -1,3 +1,4 @@ +/** @module @category API */ import { useEffect, useReducer } from "react"; import { fetchCurrentPatient, PatientUuid } from "@openmrs/esm-api"; diff --git a/packages/framework/esm-react-utils/src/useExtensionSlotMeta.ts b/packages/framework/esm-react-utils/src/useExtensionSlotMeta.ts index 7ee39dd89..4c28e4ea9 100644 --- a/packages/framework/esm-react-utils/src/useExtensionSlotMeta.ts +++ b/packages/framework/esm-react-utils/src/useExtensionSlotMeta.ts @@ -1,3 +1,4 @@ +/** @module @category Extension */ import { ExtensionMeta } from "@openmrs/esm-extensions"; import { useMemo } from "react"; import { useConnectedExtensions } from "./useConnectedExtensions"; diff --git a/packages/framework/esm-react-utils/src/useExtensionStore.ts b/packages/framework/esm-react-utils/src/useExtensionStore.ts index c00427e00..803efece4 100644 --- a/packages/framework/esm-react-utils/src/useExtensionStore.ts +++ b/packages/framework/esm-react-utils/src/useExtensionStore.ts @@ -1,3 +1,4 @@ +/** @module @category Extension */ import { ExtensionStore, getExtensionStore } from "@openmrs/esm-extensions"; import { createUseStore } from "./createUseStore"; diff --git a/packages/framework/esm-react-utils/src/useLayoutType.ts b/packages/framework/esm-react-utils/src/useLayoutType.ts index f4f298b7c..2b48734b5 100644 --- a/packages/framework/esm-react-utils/src/useLayoutType.ts +++ b/packages/framework/esm-react-utils/src/useLayoutType.ts @@ -1,3 +1,4 @@ +/** @module @category UI */ import { useEffect, useState } from "react"; export type LayoutType = "tablet" | "phone" | "desktop"; diff --git a/packages/framework/esm-react-utils/src/useLocations.tsx b/packages/framework/esm-react-utils/src/useLocations.tsx index d64d59de6..e1fc28e0b 100644 --- a/packages/framework/esm-react-utils/src/useLocations.tsx +++ b/packages/framework/esm-react-utils/src/useLocations.tsx @@ -1,3 +1,4 @@ +/** @module @category API */ import { getLocations, Location } from "@openmrs/esm-api"; import { useState, useEffect } from "react"; diff --git a/packages/framework/esm-react-utils/src/useOnClickOutside.tsx b/packages/framework/esm-react-utils/src/useOnClickOutside.tsx index 6b759c7a5..7d79b0106 100644 --- a/packages/framework/esm-react-utils/src/useOnClickOutside.tsx +++ b/packages/framework/esm-react-utils/src/useOnClickOutside.tsx @@ -1,3 +1,4 @@ +/** @module @category UI */ import { useRef, useEffect } from "react"; export function useOnClickOutside( @@ -10,7 +11,7 @@ export function useOnClickOutside( if (active) { const listener = (event: Event) => { if (ref?.current?.contains(event.target as Node)) { - return; + return; } handler(event); diff --git a/packages/framework/esm-react-utils/src/usePagination.ts b/packages/framework/esm-react-utils/src/usePagination.ts index 7089bb791..7a330e8eb 100644 --- a/packages/framework/esm-react-utils/src/usePagination.ts +++ b/packages/framework/esm-react-utils/src/usePagination.ts @@ -1,3 +1,4 @@ +/** @module @category UI */ import { useMemo, useState } from "react"; const defaultResultsPerPage = 10; diff --git a/packages/framework/esm-react-utils/src/usePatient.ts b/packages/framework/esm-react-utils/src/usePatient.ts index dcd2d201d..bed3a059b 100644 --- a/packages/framework/esm-react-utils/src/usePatient.ts +++ b/packages/framework/esm-react-utils/src/usePatient.ts @@ -1,7 +1,8 @@ +/** @module @category API */ import { useEffect, useReducer } from "react"; import { fetchCurrentPatient, PatientUuid } from "@openmrs/esm-api"; -type NullablePatient = fhir.Patient | null; +export type NullablePatient = fhir.Patient | null; interface CurrentPatientState { patientUuid: string | null; diff --git a/packages/framework/esm-react-utils/src/useSessionUser.tsx b/packages/framework/esm-react-utils/src/useSessionUser.tsx index 510caceb4..9fb730e7c 100644 --- a/packages/framework/esm-react-utils/src/useSessionUser.tsx +++ b/packages/framework/esm-react-utils/src/useSessionUser.tsx @@ -1,3 +1,4 @@ +/** @module @category API */ import { openmrsObservableFetch, SessionUser } from "@openmrs/esm-api"; import { useState, useEffect } from "react"; diff --git a/packages/framework/esm-react-utils/src/useStore.ts b/packages/framework/esm-react-utils/src/useStore.ts index 8253fad13..6965eada9 100644 --- a/packages/framework/esm-react-utils/src/useStore.ts +++ b/packages/framework/esm-react-utils/src/useStore.ts @@ -1,3 +1,4 @@ +/** @module @category Store */ import { subscribeTo } from "@openmrs/esm-state"; import { useEffect, useMemo, useState } from "react"; import { Store } from "unistore"; diff --git a/packages/framework/esm-react-utils/src/useVisit.ts b/packages/framework/esm-react-utils/src/useVisit.ts index e3e3b6a50..d86914509 100644 --- a/packages/framework/esm-react-utils/src/useVisit.ts +++ b/packages/framework/esm-react-utils/src/useVisit.ts @@ -1,3 +1,4 @@ +/** @module @category API */ import { defaultVisitCustomRepresentation, openmrsFetch, diff --git a/packages/framework/esm-react-utils/src/useVisitTypes.ts b/packages/framework/esm-react-utils/src/useVisitTypes.ts index a7d635551..62682c0ed 100644 --- a/packages/framework/esm-react-utils/src/useVisitTypes.ts +++ b/packages/framework/esm-react-utils/src/useVisitTypes.ts @@ -1,3 +1,4 @@ +/** @module @category API */ import { getVisitTypes, VisitType } from "@openmrs/esm-api"; import { useEffect, useState } from "react"; diff --git a/packages/framework/esm-state/src/public.ts b/packages/framework/esm-state/src/public.ts new file mode 100644 index 000000000..050cc2847 --- /dev/null +++ b/packages/framework/esm-state/src/public.ts @@ -0,0 +1,7 @@ +export { + AppState, + createGlobalStore, + getGlobalStore, + getAppState, + subscribeTo, +} from "./state"; diff --git a/packages/framework/esm-state/src/state.ts b/packages/framework/esm-state/src/state.ts index c2fd6ee71..271c62140 100644 --- a/packages/framework/esm-state/src/state.ts +++ b/packages/framework/esm-state/src/state.ts @@ -1,3 +1,4 @@ +/** @module @category Store */ import createStore, { Store } from "unistore"; interface StoreEntity { diff --git a/packages/framework/esm-styleguide/src/modals/index.tsx b/packages/framework/esm-styleguide/src/modals/index.tsx index 83498c4a2..3695b08aa 100644 --- a/packages/framework/esm-styleguide/src/modals/index.tsx +++ b/packages/framework/esm-styleguide/src/modals/index.tsx @@ -1,3 +1,4 @@ +/** @module @category UI */ import { renderExtension } from "@openmrs/esm-extensions"; import { createGlobalStore } from "@openmrs/esm-state"; diff --git a/packages/framework/esm-styleguide/src/notifications/index.tsx b/packages/framework/esm-styleguide/src/notifications/index.tsx index 83b620cd8..7115bd2b3 100644 --- a/packages/framework/esm-styleguide/src/notifications/index.tsx +++ b/packages/framework/esm-styleguide/src/notifications/index.tsx @@ -1,3 +1,4 @@ +/** @module @category UI */ import React from "react"; import { render } from "react-dom"; import { Subject } from "rxjs"; diff --git a/packages/framework/esm-styleguide/src/notifications/notification.component.tsx b/packages/framework/esm-styleguide/src/notifications/notification.component.tsx index 2ec7f5a59..cd028f331 100644 --- a/packages/framework/esm-styleguide/src/notifications/notification.component.tsx +++ b/packages/framework/esm-styleguide/src/notifications/notification.component.tsx @@ -1,5 +1,6 @@ import React from "react"; import { InlineNotification } from "carbon-components-react"; +/** @module @category UI */ export interface NotificationProps { notification: InlineNotificationMeta; diff --git a/packages/framework/esm-styleguide/src/public.ts b/packages/framework/esm-styleguide/src/public.ts new file mode 100644 index 000000000..0805617d4 --- /dev/null +++ b/packages/framework/esm-styleguide/src/public.ts @@ -0,0 +1,12 @@ +export { showNotification } from "./notifications"; +export { + NotificationDescriptor, + InlineNotificationType, +} from "./notifications/notification.component"; +export { showToast } from "./toasts"; +export { showModal } from "./modals"; +export { + ToastDescriptor, + ToastType, + ToastNotificationMeta, +} from "./toasts/toast.component"; diff --git a/packages/framework/esm-styleguide/src/toasts/index.tsx b/packages/framework/esm-styleguide/src/toasts/index.tsx index bb3aea709..697826c01 100644 --- a/packages/framework/esm-styleguide/src/toasts/index.tsx +++ b/packages/framework/esm-styleguide/src/toasts/index.tsx @@ -1,3 +1,4 @@ +/** @module @category UI */ import React from "react"; import { render } from "react-dom"; import { Subject } from "rxjs"; diff --git a/packages/framework/esm-styleguide/src/toasts/toast.component.tsx b/packages/framework/esm-styleguide/src/toasts/toast.component.tsx index 5f552a5fb..f77565171 100644 --- a/packages/framework/esm-styleguide/src/toasts/toast.component.tsx +++ b/packages/framework/esm-styleguide/src/toasts/toast.component.tsx @@ -1,3 +1,4 @@ +/** @module @category UI */ import React, { useEffect, useState } from "react"; import { ToastNotification } from "carbon-components-react"; diff --git a/packages/framework/esm-utils/src/age-helpers.tsx b/packages/framework/esm-utils/src/age-helpers.tsx index f37c917e3..d936dbebc 100644 --- a/packages/framework/esm-utils/src/age-helpers.tsx +++ b/packages/framework/esm-utils/src/age-helpers.tsx @@ -1,3 +1,5 @@ +/** @module @category Utility */ + /** * Gets the number of days in the year of the given date. * @param date The date to compute the days within the year. diff --git a/packages/framework/esm-utils/src/omrs-dates.ts b/packages/framework/esm-utils/src/omrs-dates.ts index 7822e035d..a30cc61ea 100644 --- a/packages/framework/esm-utils/src/omrs-dates.ts +++ b/packages/framework/esm-utils/src/omrs-dates.ts @@ -1,6 +1,6 @@ /** * @module - * @category Date and time + * @category Date and Time */ import { i18n } from "i18next"; import dayjs from "dayjs"; diff --git a/packages/framework/esm-utils/src/retry.ts b/packages/framework/esm-utils/src/retry.ts index 98ac11e89..e1c3dc255 100644 --- a/packages/framework/esm-utils/src/retry.ts +++ b/packages/framework/esm-utils/src/retry.ts @@ -1,3 +1,5 @@ +/** @module @category Utility */ + /** * Options for configuring the behavior of the {@link retry} function. */ diff --git a/packages/framework/esm-utils/src/translate.ts b/packages/framework/esm-utils/src/translate.ts index fa3baef62..b75e21286 100644 --- a/packages/framework/esm-utils/src/translate.ts +++ b/packages/framework/esm-utils/src/translate.ts @@ -1,3 +1,4 @@ +/** @module @category Utility */ import _i18n from "i18next"; export function translateFrom( diff --git a/packages/framework/esm-utils/src/version.ts b/packages/framework/esm-utils/src/version.ts index ae6c466b8..f72a5a2f9 100644 --- a/packages/framework/esm-utils/src/version.ts +++ b/packages/framework/esm-utils/src/version.ts @@ -1,3 +1,4 @@ +/** @module @category Utility */ import * as semver from "semver"; function normalizeOnlyVersion(version: string) { diff --git a/packages/shell/esm-app-shell/src/apps.ts b/packages/shell/esm-app-shell/src/apps.ts index 9f0d83bed..146d56e3d 100644 --- a/packages/shell/esm-app-shell/src/apps.ts +++ b/packages/shell/esm-app-shell/src/apps.ts @@ -7,7 +7,7 @@ import { registerExtension, ResourceLoader, Lifecycle, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import { registerApplication } from "single-spa"; import { routePrefix, routeRegex, wrapLifecycle } from "./helpers"; import type { Activator, ActivatorDefinition } from "./types"; diff --git a/packages/shell/esm-app-shell/src/index.ts b/packages/shell/esm-app-shell/src/index.ts index 967c50515..56f8243f9 100644 --- a/packages/shell/esm-app-shell/src/index.ts +++ b/packages/shell/esm-app-shell/src/index.ts @@ -4,7 +4,7 @@ import { setupPaths, setupUtils, SpaConfig, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; declare var __webpack_public_path__: string; diff --git a/packages/shell/esm-app-shell/src/run.ts b/packages/shell/esm-app-shell/src/run.ts index e05f280be..19c26e120 100644 --- a/packages/shell/esm-app-shell/src/run.ts +++ b/packages/shell/esm-app-shell/src/run.ts @@ -22,7 +22,7 @@ import { activateOfflineCapability, subscribePrecacheStaticDependencies, openmrsFetch, -} from "@openmrs/esm-framework"; +} from "@openmrs/esm-framework/src/internal"; import { finishRegisteringAllApps, registerApp,