import Popup from "./class/utils/Popup";


type ResponseHandlers = ((url: string, responseBody: {
    json: unknown,
    text: string,
    isModified: boolean
}, opt: {
    method: string,
    requestBody: unknown
}) => void)[];

/**
 * 通用全局参数
 */
class GlobVars {
    // 监听到的fetch数据
    WH_NET_LOG: unknown[] = [];
    map: { [key: string]: unknown } = {};
    responseHandlers: ResponseHandlers = [];
    version = '$$WUHU_DEV_VERSION$$';
    popup_node: MyHTMLElement | Popup = null;
    actionList: {
        txt: string,
        func: (ev: Event) => void
    }[] = [];
    loadTime: number = 0;
}

export default new GlobVars();
