import { ReplaySubject } from 'rxjs'; import { AppProps } from 'single-spa'; import { Encounter, EncounterCreate } from './app/types'; export const singleSpaPropsSubject = new ReplaySubject(1); type VisitProperties = { visitTypeUuid?: string; visitUuid?: string; visitStartDatetime: string; visitStopDatetime: string; }; type EncounterProperties = { encounterUuid?: string; handleEncounterCreate?: (encounter: EncounterCreate) => void; handlePostResponse?: (encounter: Encounter) => void; }; type PatientProperties = { patient: any; patientUuid: string; }; type UIBehavior = { view: string; closeWorkspace: () => void; closeWorkspaceWithSavedChanges?: () => void; promptBeforeClosing?: (testFcn: () => boolean) => void; handleOnValidate?: (valid: boolean) => void; showDiscardSubmitButtons?: boolean; }; type Form = { formUuid: string; }; type PreFilledQuestions = { [key: string]: string; }; // Add any custom single-spa props you have to this type def // https://single-spa.js.org/docs/building-applications.html#custom-props export type SingleSpaProps = AppProps & Form & UIBehavior & VisitProperties & EncounterProperties & PatientProperties & PreFilledQuestions & { additionalProps?: any; };