decord/alpha/source/lib/guild/GuildThreadSubscriptions.tsx

90 lines
2.3 KiB
TypeScript
Raw Normal View History

// Module ID: 6892
// Function ID: 6893
// Name: GuildThreadSubscriptions
// Dependencies: [1439, 2]
2026-07-20 16:05:17 +00:00
// Module 6892 (GuildThreadSubscriptions)
import privDefault from "priv" /* 1439 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
let result = size.fileFinishedImporting("lib/guild/GuildThreadSubscriptions.tsx");
2026-07-29 08:29:29 +00:00
class GuildThreadSubscriptions {
constructor(arg0) {
merged = Object.assign({ _subscriptions: null });
merged[0] = {};
merged._onChange = global;
return merged;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
const prototype = GuildThreadSubscriptions.prototype;
prototype["reset"] = function reset() {
this._subscriptions = {};
};
prototype["get"] = function get(arg0) {
return this._get(arg0).keys();
};
prototype["getSubscribedThreadIds"] = function getSubscribedThreadIds() {
const set = new Set();
for (const key10010 in this._subscriptions) {
let obj2 = this._subscriptions[key10010];
let keys = obj2.keys();
for (const item10012 of keys) {
let addResult = set.add(item10012);
continue;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return set;
};
prototype["_get"] = function _get(arg0) {
let tmp = this._subscriptions[arg0];
if (tmp == null) {
2026-08-24 06:08:38 +00:00
tmp = new privDefault({ max: 3, updateAgeOnGet: true });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp;
};
prototype["clear"] = function clear(arg0) {
const self = this;
if (arg0 in this._subscriptions) {
const _subscriptions = self._subscriptions;
delete tmp[tmp2];
self._onChange(arg0, []);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
prototype["subscribe"] = function subscribe(arg0, arg1, arg2) {
const self = this;
const _getResult = this._get(arg0);
if (_getResult.has(arg1)) {
const _Date3 = Date;
const result = _getResult.set(arg1, Date.now());
let flag = false;
} else {
if (tmp3) {
const _Date = Date;
const result1 = _getResult.set(arg2, Date.now());
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const _Date2 = Date;
const result2 = _getResult.set(arg1, Date.now());
self._subscriptions[arg0] = _getResult;
self._onChange(arg0, _getResult.keys());
flag = true;
tmp3 = null != arg2 && _getResult.has(arg2);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return flag;
};
prototype["unsubscribe"] = function unsubscribe(arg0, arg1) {
const self = this;
if (arg0 in this._subscriptions) {
let flag2 = obj.has(arg1);
if (flag2) {
obj.del(arg1);
self._onChange(arg0, obj.keys());
flag2 = true;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return flag2;
} else {
return false;
}
};
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default GuildThreadSubscriptions;