import { App } from 'vue';
import { Component } from 'vue';
import { ComponentPublicInstance } from 'vue';
import { Ref } from 'vue';

export declare const flashMessage: FlashMessagePlugin;

declare type FlashMessageContainerPosition = 'right bottom' | 'right top' | 'left bottom' | 'left top';

declare interface FlashMessageDimensionsObject {
    height: number;
    id: number;
    isImgLoaded: boolean;
}

declare interface FlashMessageGroup {
    [propName: string]: FlashMessageGroupItem;
}

declare interface FlashMessageGroupItem {
    timeoutId: number | undefined;
    messages: Ref<FlashMessageSerializedObject[]>;
    strategy: Ref<FlashMessageStrategy>;
    currentHeight: Ref<number>;
    defaultTime: number;
}

declare interface FlashMessageObject {
    title?: string;
    text?: string;
    type?: string;
    group?: keyof FlashMessagePlugin['groups'];
    space?: number;
    image?: string;
    time?: number;
    clickable?: boolean;
    x?: string;
    y?: string;
    component?: Component;
    props?: object;
    html?: string;
    position?: FlashMessageContainerPosition;
    blockClass?: string;
    imageClass?: string;
    contentClass?: string;
    beforeCreate?: (flashMessageInstance: ComponentPublicInstance, messageObj: FlashMessageSerializedObject) => any;
    created?: (flashMessageInstance: ComponentPublicInstance, messageObj: FlashMessageSerializedObject) => any;
    beforeMount?: (flashMessageInstance: ComponentPublicInstance, messageObj: FlashMessageSerializedObject) => any;
    mounted?: (flashMessageInstance: ComponentPublicInstance, messageObj: FlashMessageSerializedObject) => any;
    beforeUpdate?: (flashMessageInstance: ComponentPublicInstance, messageObj: FlashMessageSerializedObject) => any;
    updated?: (flashMessageInstance: ComponentPublicInstance, messageObj: FlashMessageSerializedObject) => any;
    beforeUnmount?: (flashMessageInstance: ComponentPublicInstance, messageObj: FlashMessageSerializedObject) => any;
    unmounted?: (flashMessageInstance: ComponentPublicInstance, messageObj: FlashMessageSerializedObject) => any;
}

export declare class FlashMessagePlugin {
    groups: FlashMessageGroup;
    nextMessageId: number;
    constructor();
    registerGroup(groupName: string, group: FlashMessageRegisterObject): void;
    private changeHeight;
    setDimensions(group: keyof FlashMessagePlugin['groups'], options: FlashMessageDimensionsObject): void;
    show(messageObject: FlashMessageObject): FlashMessageSerializedObject;
    changeStrategy(strategy: FlashMessageStrategy, group?: keyof FlashMessagePlugin['groups']): void;
    remove(id: number, group?: keyof FlashMessagePlugin['groups']): void;
    removeAll(group?: keyof FlashMessagePlugin['groups']): void;
}

declare interface FlashMessageRegisterObject {
    time: number;
    strategy: FlashMessageStrategy;
    position: FlashMessageContainerPosition;
}

declare interface FlashMessageSerializedObject extends FlashMessageObject {
    [x: string]: any;
    id: number;
    group: keyof FlashMessageGroup;
    yAxis: number;
}

declare type FlashMessageStrategy = 'multiple' | 'single';

declare function install(app: App): void;

declare namespace install {
    var installed: boolean;
}
export default install;

export { }
