wuhu-torn-helper/src/ts/globVars.ts
2023-06-19 17:27:58 +08:00

31 lines
658 B
TypeScript

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();