UNPKG

@arrowhealth/bridge-sdk

Version:

Bridge SDK provides web applications the ability to integrate with the Bridge Platform.

92 lines (91 loc) 3.06 kB
import { AuthStatus, AuthUser, Page, Patient, Platform, PushNotification } from './interfaces'; /** * Return user session info * * @returns */ export declare function getAuthUser(): Promise<AuthUser>; /** * Return the current page HTML and href. * * @returns */ export declare function getPage(deep?: boolean): Promise<Page>; /** * Get the current patient being displayed. This is typically used on application * initialization and thereafter onPatientChanged() is used to listen for additional * changes. * * @returns */ export declare function getPatient(): Promise<Patient>; export declare function getPlatform(): Promise<Platform>; /** * Sets the badge count on the tile. Setting the value to 0 will cause it to go away * * @param count * */ export declare function setBadgeCount(count?: number): void; /** * Shows tile. Controlled by a Smart Tile based on the * information it receives through the available hooks such as "onPatientChanged()" */ export declare function showTile(): void; /** * Hide tile. Controlled by a Smart Tile based on the * information it receives through the available hooks such as "onPatientChanged()" */ export declare function hideTile(): void; /** * Enables tile allowing event handling. Controlled by a Smart Tile based on the * information it receives through the available hooks such as "onPatientChanged()" */ export declare function enableTile(): void; /** * Disables tile preventing user events. Controlled by a Smart Tile based on the * information it receives through the available hooks such as "onPatientChanged()" */ export declare function disableTile(): void; /** * Returns the status of the application known to Bridge set by application */ export declare function getAuthStatus(): Promise<AuthStatus>; /** * Tells Bridge when authentication is complete. Set isAuthenticated * to false when authentication is required. This will open the * authentication panel where you have declared your Authentication * page. * * @param status */ export declare function setAuthStatus(status: AuthStatus): void; /** * Smart tile request to capture user events. Bridge will not open an application while * tile is capturing user events. */ export declare function captureUserEvents(): void; /** * Smart tile returns the capturing user events back to Bridge. Bridge can only open * application when Bridge is capturing user events. */ export declare function releaseUserEvents(): void; /** * Closes app making the request. The tile can also call this and it will close the linked application. */ export declare function closeApp(): void; /** * Bridge will add the notification to the notifications array * with icon representing the application * * @param text Message to display * @param patientId EHR patient ID */ export declare function pushNotification(notification: PushNotification): void; /** * Subscribe to the patient change event * * @param handle * @returns off */ export declare function onPatientChanged(handle: (patient: Patient) => void): Function;