/* 全局可变状态集中处。 * * 原实现里 map.js 顶部那一堆 `let xxx = ...` 是**经典脚本的全局词法绑定**, * 被 navigation/share/subscribe/map 四个脚本一起读写。改成 ES 模块后,import 进来的 * 绑定不可赋值,所以这里统一收进 S 对象;正文里的裸标识符写成 S.xxx(由 tools/gen.mjs 改写)。 * 语义不变:同一个对象、同一份可变状态、初始化顺序仍在模块求值阶段。 */ /** 状态容器类型:字段按需增删,读取处一律 any。 */ export type AppState = Record; export const S: AppState = { // static/js/share.js:208 shareAskQueue: [], // static/js/share.js:209 shareAskActive: false, // static/js/map.js:2 map: null, // static/js/map.js:3 currentType: "3", // static/js/map.js:4 currentUser: null, // static/js/map.js:5 authKickToastShown: false, // static/js/map.js:6 authMode: "login", // static/js/map.js:7 authToken: localStorage.getItem("auth_token") || null, // static/js/map.js:8 currentMarkers: [], // static/js/map.js:9 currentPolygons: [], // static/js/map.js:10 selectedBike: null, // static/js/map.js:11 markersData: {}, // static/js/map.js:12 currentMarkersById: {}, // static/js/map.js:13 scannedMarkers: {}, // static/js/map.js:14 myLocationMarker: null, // static/js/map.js:15 autoLocationMarker: null, // static/js/map.js:16 autoLocationWatchId: null, // static/js/map.js:17 hasLocationPermission: false, // static/js/map.js:18 initialLocationCentered: false, // static/js/map.js:19 nearestBikeId: null, // static/js/map.js:20 isFirstLoad: true, // static/js/map.js:21 highlightedBikeId: null, // static/js/map.js:23 bikeClusteringEnabled: typeof BikeClusters !== "undefined" ? BikeClusters.readClusteringPreference(localStorage) : true, // static/js/map.js:122 activeRental: null, // static/js/map.js:123 rentalCountdownTimer: null, // static/js/map.js:1658 currentOrder: null, // static/js/map.js:3276 _fitCardTimer: null, // static/js/map.js:3582 _findClickCount: 0, // static/js/map.js:3584 _findLongPressTimer: null, }; // static/js/map.js:124 export const RENTAL_KEY = "xbniu_rental_key";