UNPKG

vscroll

Version:
30 lines 1.05 kB
import { AdapterPropName } from './props'; var getBox = function (id) { var _a; return (_a = wantedStorage.get(id || -1)) === null || _a === void 0 ? void 0 : _a.box; }; var setBox = function (_a, id) { var name = _a.name, wanted = _a.wanted; var Wanted = wantedStorage.get(id || -1); if (wanted && Wanted && !Wanted.box[name] && !Wanted.block) { var a = AdapterPropName.firstVisible, a$ = AdapterPropName.firstVisible$; var b = AdapterPropName.lastVisible, b$ = AdapterPropName.lastVisible$; Wanted.box[a] = Wanted.box[a$] = [a, a$].some(function (n) { return n === name; }) || Wanted.box[a]; Wanted.box[b] = Wanted.box[b$] = [b, b$].some(function (n) { return n === name; }) || Wanted.box[b]; return true; } return false; }; var setBlock = function (value, id) { var Wanted = wantedStorage.get(id || -1); if (Wanted) { Wanted.block = value; } }; export var wantedUtils = { getBox: getBox, setBox: setBox, setBlock: setBlock }; export var wantedStorage = new Map(); //# sourceMappingURL=wanted.js.map