import { ThunkAction } from "redux-thunk"; import { CustomFile, EditableCustomFile, ExcludedEhrCodes, State, ToggleableAlert } from "../State"; import { AnyAction } from "redux"; import { BBox } from "../../computations/BBox"; export declare enum CustomBuildingsActionsType { ALERT_CREATION_ERROR = "ALERT_CREATION_ERROR", ALERT_CREATION_PROCESSING = "ALERT_CREATION_PROCESSING", ALERT_CREATION_SUCCESS = "ALERT_CREATION_SUCCESS", ALERT_DISMISSAL_ERROR = "ALERT_DISMISSAL_ERROR", ALERT_DISMISSAL_PROCESSING = "ALERT_DISMISSAL_PROCESSING", ALERT_DISMISSAL_SUCCESS = "ALERT_DISMISSAL_SUCCESS", APPEND_FILE = "APPEND_FILE", APPEND_SHARED_FILE = "APPEND_SHARED_FILE", TOGGLE_FILE = "TOGGLE_FILE", TOGGLE_ALL_FILES = "TOGGLE_ALL_FILES", DELETING_FILE = "DELETING_FILE", TOGGLE_SIMPLE_FILE = "TOGGLE_SIMPLE_FILE", CLEAR_FILES = "CLEAR_FILES", CLEAR_FILES_SHARED = "CLEAR_FILES_SHARED", QUEUE_TO_FLY = "QUEUE_TO_FLY", INITIALISE_SHARED_CODES = "INITIALISE_SHARED_CODES", APPEND_EHR_CODES_TO_FILE = "APPEND_EHR_CODES_TO_FILE" } interface AlertCreation { type: CustomBuildingsActionsType.ALERT_CREATION_ERROR | CustomBuildingsActionsType.ALERT_CREATION_PROCESSING | CustomBuildingsActionsType.ALERT_CREATION_SUCCESS; payload: { alert: ToggleableAlert; }; } export declare function createErrorAlert(alert: ToggleableAlert): AlertCreation; export declare function createProcessingAlert(alert: ToggleableAlert): AlertCreation; export declare function createSuccessAlert(alert: ToggleableAlert): AlertCreation; interface AlertDismissal { type: CustomBuildingsActionsType.ALERT_DISMISSAL_PROCESSING | CustomBuildingsActionsType.ALERT_DISMISSAL_ERROR | CustomBuildingsActionsType.ALERT_DISMISSAL_SUCCESS; payload: { code: String; }; } export declare function dismissProcessingAlert(code: string): AlertDismissal; export declare function dismissErrorAlert(code: string): AlertDismissal; export declare function dismissSucceededAlert(code: string): AlertDismissal; interface ToggleFile { type: CustomBuildingsActionsType.TOGGLE_FILE | CustomBuildingsActionsType.TOGGLE_SIMPLE_FILE; payload: { code: string; toState: boolean; }; } export declare function toggleFile(code: string, toState: boolean): ToggleFile; interface ToggleAction { type: CustomBuildingsActionsType.TOGGLE_ALL_FILES; payload: { toState: boolean; }; } export declare function toggleAllFiles(toState: boolean): ToggleAction; interface ToggleFileDeleting { type: CustomBuildingsActionsType.DELETING_FILE; payload: { code: string; }; } export declare function toggleDeletingFile(code: string): ToggleFileDeleting; export declare function toggleSimpleFile(code: string, toState: boolean): ToggleFile; interface AppendFile { type: CustomBuildingsActionsType.APPEND_FILE; payload: { file: EditableCustomFile; }; } export declare function appendFile(file: EditableCustomFile): { type: CustomBuildingsActionsType; payload: { file: EditableCustomFile; }; }; interface AppendEhrCodesToFile { type: CustomBuildingsActionsType.APPEND_EHR_CODES_TO_FILE; payload: { fileCode: string; codes: ExcludedEhrCodes; }; } export declare function appendEhrCodesToFile(fileCode: string, codes: ExcludedEhrCodes): AppendEhrCodesToFile; interface EmptyAction { type: CustomBuildingsActionsType.CLEAR_FILES | CustomBuildingsActionsType.CLEAR_FILES_SHARED; payload: {}; } export declare function clearFiles(): EmptyAction; export declare function clearSharedFiles(): EmptyAction; interface QueueFileToFly { type: CustomBuildingsActionsType.QUEUE_TO_FLY; payload: { code: string | undefined; }; } export declare function queueFileToFly(code: string | undefined): { type: CustomBuildingsActionsType; payload: { code: string | undefined; }; }; interface AppendSharedFile { type: CustomBuildingsActionsType.APPEND_SHARED_FILE; payload: { sharedFile: CustomFile; }; } export declare function appendSharedFile(file: CustomFile): AppendSharedFile; interface InitialiseSharedCodes { type: CustomBuildingsActionsType.INITIALISE_SHARED_CODES; payload: { sharedCodes: string[]; }; } export declare function initialiseSharedCodes(codes: string[]): InitialiseSharedCodes; export type CustomBuildingsActions = AlertDismissal | ToggleFile | ToggleFileDeleting | AlertCreation | AppendFile | QueueFileToFly | AppendSharedFile | ToggleAction | InitialiseSharedCodes | EmptyAction | AppendEhrCodesToFile; /** * Requests the buildings that the user has uploaded (either some seconds ago or in the past) */ export declare function requestUserBuildings(app_url: string): ThunkAction; export declare function postUserBuildings(files: File[], app_url: string): ThunkAction; export declare function requestCheckBuildingStatus(code: string, name: string, app_url: string): ThunkAction; export declare function requestDeleteBuilding(code: string, name: string, app_url: string): ThunkAction; /** * Requests the building that are shared with the user */ export declare function requestSharedBuildings(codes: string[], app_url: string): ThunkAction; export declare function getHiddenEhrCodes(code: string, bbox: BBox, then?: (codes: ExcludedEhrCodes) => void): ThunkAction; export {};