import { Bundle } from 'fhir/r5';
import { CSSResult } from 'lit';
import { LitElement } from 'lit';
import { PropertyValues } from 'lit';
import { TemplateResult } from 'lit-html';

declare interface AlertVisibility {
    visibility: {
        interactionsLv1: boolean;
        interactionsLv2: boolean;
        interactionsLv3: boolean;
        interactionsLv4: boolean;
        anticholinergic: boolean;
        surdosages?: boolean;
        redondances_composant: boolean;
        redondances_classe: boolean;
        precautions_emploi: boolean;
        contre_indicationsLv3: boolean;
        contre_indicationsLv4: boolean;
        allergies: boolean;
        stopp: boolean;
        posologies: boolean;
        ipc: boolean;
    };
    collapsed: {
        interactionsLv1?: boolean;
        interactionsLv2?: boolean;
        redundancies?: boolean;
    };
}

declare enum GroupingType {
    Prescription = "prescription",
    ATC = "atc",
    Prescriptor = "prescriptor",
    None = "none"
}

declare interface PatientProfilePreferences {
    typePathology?: "" | "AMM" | "CIM10";
}

declare interface ProductPreferences {
    sorting: SortingType;
    grouping: GroupingType;
}

export declare const setLocale: ((newLocale: string) => Promise<void>) & {
    _LIT_LOCALIZE_SET_LOCALE_?: never;
};

/**
 * BCB shared-medication-review element.
 */
export declare class SharedMedicationReview extends LitElement {
    language: string;
    apiPrescriptionScannerUrl: string;
    apiBcbUrl: string;
    apiKey: string | undefined;
    patientProfile: Bundle | undefined;
    prescriptions: Bundle[];
    files: File[];
    preferences: UserPreferences;
    private _scanRunning;
    private _scanErrors;
    private _filesToScan;
    /** Visibility overridden by user interaction via the filter popover. */
    private _userChangedVisibility;
    /** Effective alert visibility: user override takes precedence, falls back to preferences. */
    private get _alertVisibility();
    connectedCallback(): void;
    disconnectedCallback(): void;
    willUpdate(changedProperties: PropertyValues): void;
    updated(changedProperties: Map<string | number | symbol, unknown>): void;
    private _handleAlertVisibilityChanged;
    private updatePatientProfile;
    render(): TemplateResult<1>;
    handleFinishAnalysis(): void;
    updatePrescription(event: CustomEvent): void;
    handleCommentaryUpdate(event: CustomEvent): void;
    handleScrollToSideEffects(): void;
    private alertDismiss;
    private _filterFilesToScan;
    private _processNewFiles;
    static styles: CSSResult;
}

export declare interface SharedMedicationReviewProps {
    language: string;
    apiPrescriptionScannerUrl: string;
    apiKey: string;
    apiBcbUrl: string;
    patientProfile: Bundle;
    prescriptions: Bundle[];
    files: File[];
    preferences: UserPreferences;
}

declare enum SortingType {
    Asc = "asc",
    Desc = "desc",
    None = "none"
}

declare interface UserPreferences {
    products: ProductPreferences;
    alerts: AlertVisibility;
    patientProfile?: PatientProfilePreferences;
}

export { }


declare global {
    interface HTMLElementTagNameMap {
        "bcb-shared-medication-review": SharedMedicationReview;
    }
}


declare global {
    interface HTMLElementTagNameMap {
        "bcb-alerts-filter-popover": AlertsFilterPopover;
    }
}


declare global {
    interface HTMLElementTagNameMap {
        "bcb-prescription-container": PrescriptionContainer;
    }
}


declare global {
    interface HTMLElementTagNameMap {
        "bcb-prescription-watcher-modal": PrescriptionWatcherModal;
    }
}


declare global {
    interface HTMLElementTagNameMap {
        "bcb-commentary-modal": CommentaryModal;
    }
}


declare global {
    interface HTMLElementTagNameMap {
        "bcb-scan-prescription-view": ScanPrescriptionView;
    }
}


declare global {
    interface HTMLElementTagNameMap {
        "bcb-add-products-view": AddProductsView;
    }
}


declare global {
    interface HTMLElementTagNameMap {
        "bcb-prescription-item-card-bpm": PrescriptionItemCard;
    }
}


declare global {
    interface HTMLElementTagNameMap {
        "bcb-original-medication-display": OriginalMedicationDisplay;
    }
}


declare global {
    interface Window {
        BCB_SHARED_MED_REVIEW_CONFIG?: {
            STORYBOOK_API_PRESCRIPTION_SCANNER_URL?: string;
            STORYBOOK_API_BCB_URL?: string;
            STORYBOOK_API_KEY?: string;
        };
    }
}
