class MvMessage {
    messageDiv: HTMLElement;
    messageAlert: HTMLElement
    type: string;
    constructor() {
        this.messageDiv = window.document.getElementById('messageDiv');
        this.messageAlert = window.document.getElementById('messageAlert');
        console.log(this.messageDiv)
        console.log(this.messageAlert)
    }
    showMessage(type?, message?) {
        switch (type) {
            case 'success': this.type = 'alert-success';break;
            case 'danger': this.type = 'alert-danger';break;
            case 'warning': this.type = 'alert-warning';break;
            case 'primary': this.type = 'alert-primary';break;
            default: this.type = 'alert-info';break;
        }
        console.log(this.type)
        this.messageDiv.classList.add('showMessage');
        this.messageAlert.classList.add(this.type);
        this.messageAlert.innerHTML=message;
        setTimeout(()=>{
            this.messageDiv.classList.remove('showMessage');
            setTimeout(()=>{
                this.messageAlert.classList.remove(this.type);
            },1000)
        },3000)
    }
}
export {MvMessage}
