import { activityMonitor, sessionRefreshTimer, shellApi } from "./api/api";
import { disposeFeatures } from "./features/bootstrapper";
import { ExitShellPayload } from "./features/exit/request";
export const disposeShell = () => {
  disposeFeatures(shellApi);
  shellApi.interactionService.dispose();
  sessionRefreshTimer.stop();
  activityMonitor.stop();
};

export const raiseCloseEvent = () => {
  shellApi.ecapEventManager.publish("CLOSE_FORM", "", {});
};

export const raiseCustomCloseEvent = (event: ExitShellPayload) => {
  shellApi.ecapEventManager.publish(event.ecapEvent as string, "", event.payload);
};
