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

80 lines
2 KiB
TypeScript
Raw Normal View History

2026-10-06 11:16:32 +00:00
// Module ID: 6799
// Function ID: 6800
// Name: GuildChannelSubscriptions
2026-10-03 08:58:59 +00:00
// Dependencies: [1444, 12, 2]
2026-07-23 10:11:24 +00:00
2026-10-06 11:16:32 +00:00
// Module 6799 (GuildChannelSubscriptions)
import _modDef12 from "module_12" /* 12 */;
2026-10-03 08:58:59 +00:00
import LRUCacheDefault from "LRUCache" /* 1444 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
let result = size.fileFinishedImporting("lib/guild/GuildChannelSubscriptions.tsx");
2026-07-29 08:29:29 +00:00
class GuildChannelSubscriptions {
2026-10-03 08:58:59 +00:00
constructor(_onChange) {
const merged = Object.assign({ _subscriptions: null });
merged[0] = {};
2026-10-03 08:58:59 +00:00
merged._onChange = _onChange;
return merged;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
reset() {
this._subscriptions = {};
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
get(arg0) {
const obj = {};
const _getResult = this._get(arg0);
const item = _getResult.forEach((item, index) => {
obj2[index] = item;
2026-07-29 08:29:29 +00:00
});
2026-10-03 08:58:59 +00:00
return obj;
}
_get(arg0) {
let tmp = this._subscriptions[arg0];
if (tmp == null) {
const self = this;
const self2 = this;
tmp = new LRUCacheDefault({ max: 5 });
}
return tmp;
}
clear(arg0) {
delete this._subscriptions[arg0];
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
subscribe(arg0, arg1, arg2) {
2026-10-06 11:16:32 +00:00
let flag = arg3;
if (arg3 === undefined) {
flag = false;
}
2026-10-03 08:58:59 +00:00
const self = this;
const _getResult = this._get(arg0);
2026-10-06 11:16:32 +00:00
const value = _getResult.get(arg1);
let tmp2 = !flag;
2026-10-03 08:58:59 +00:00
if (flag) {
2026-10-06 11:16:32 +00:00
tmp2 = null == value;
}
if (tmp2) {
const obj = _modDef12;
let flag2 = !obj.isEqual(value, arg2);
obj.isEqual(value, arg2);
if (flag2) {
const result = _getResult.set(arg1, arg2);
self._subscriptions[arg0] = _getResult;
const obj2 = {};
const _onChange = self._onChange;
const item = _getResult.forEach((item, index) => {
obj2[index] = item;
});
_onChange(arg0, obj2);
flag2 = true;
}
tmp2 = flag2;
2026-10-03 08:58:59 +00:00
}
2026-10-06 11:16:32 +00:00
return tmp2;
2026-10-03 08:58:59 +00:00
}
}
const prototype = GuildChannelSubscriptions.prototype;
2026-07-29 08:29:29 +00:00
const items = [[0, 99]];
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default GuildChannelSubscriptions;
2026-07-20 16:05:17 +00:00
export const MINIMUM_RANGE = 100;
export const DEFAULT_RANGES = items;