decord/alpha/source/stores/GuildMembershipStore.tsx

98 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-10-03 08:58:59 +00:00
// Module ID: 2053
// Function ID: 2054
// Name: GuildMembershipStore
2026-10-03 08:58:59 +00:00
// Dependencies: [504, 584, 2]
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
// Module 2053 (GuildMembershipStore)
import get_initializedDefault from "get initialized" /* 504 */;
import Dispatcher2 from "Dispatcher" /* 584 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const Dispatcher = Dispatcher2;
2026-10-03 08:58:59 +00:00
let _require;
2026-10-03 08:58:59 +00:00
function CACHE_LOADED(arg0) {
return closure_0.handleCacheLoaded(arg0);
}
function CACHE_LOADED_LAZY(arg0) {
return closure_0.handleCacheLoadedLazy(arg0);
}
function CONNECTION_OPEN(arg0) {
return closure_0.handleConnectionOpen(arg0);
}
function GUILD_CREATE(arg0) {
return closure_0.handleGuildCreate(arg0);
}
const Store = get_initializedDefault.Store;
2026-07-29 08:29:29 +00:00
class GuildMembershipStore extends Store {
constructor() {
2026-10-03 08:58:59 +00:00
_require = undefined;
const tmp2 = Dispatcher;
const obj = { CACHE_LOADED, CACHE_LOADED_LAZY, CONNECTION_OPEN, GUILD_CREATE, GUILD_DELETE };
2026-07-29 08:29:29 +00:00
class GUILD_DELETE {
constructor(arg0) {
2026-10-03 08:58:59 +00:00
return closure_0.handleGuildDelete(arg0);
2026-07-20 16:05:17 +00:00
}
}
2026-10-03 08:58:59 +00:00
const tmp3 = new tmp(tmp2, obj, Dispatcher2.DispatchBand.Early, GUILD_DELETE, new.target, tmp, tmp2);
_require = tmp3;
tmp3.guildIds = new Set();
new Set();
return tmp3;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
allGuildIds() {
return this.guildIds;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
isMember(arg0) {
const guildIds = this.guildIds;
return guildIds.has(arg0);
}
handleConnectionOpen(unavailableGuilds) {
const items = [...unavailableGuilds.unavailableGuilds];
this.guildIds = new Set(items);
new Set(items);
}
handleCacheLoaded(guilds) {
const f85612 = (id) => id.id;
guilds = guilds.guilds;
this.guildIds = new Set(guilds.map(f85612));
new Set(guilds.map(f85612));
}
handleCacheLoadedLazy(guilds) {
guilds = guilds.guilds;
for (const item10007 of guilds) {
let guildIds = this.guildIds;
let addResult = guildIds.add(item10007.id);
continue;
}
}
handleGuildCreate(guild) {
const guildIds = this.guildIds;
guildIds.add(guild.guild.id);
}
}
2026-07-29 08:29:29 +00:00
function handleGuildDelete(guild) {
if (true !== guild.guild.unavailable) {
const self = this;
const guildIds = this.guildIds;
guildIds.delete(guild.guild.id);
2026-07-20 16:05:17 +00:00
}
}
2026-10-03 08:58:59 +00:00
GuildMembershipStore.prototype["handleGuildDelete"] = handleGuildDelete;
2026-07-29 08:29:29 +00:00
let obj = {
2026-10-03 08:58:59 +00:00
CACHE_LOADED,
CACHE_LOADED_LAZY,
CONNECTION_OPEN,
GUILD_CREATE,
2026-07-29 08:29:29 +00:00
GUILD_DELETE(arg0) {
return closure_0.handleGuildDelete(arg0);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-10-03 08:58:59 +00:00
let tmp2 = new tmp(Dispatcher, obj, Dispatcher2.DispatchBand.Early, GuildMembershipStore, tmp, Dispatcher, obj, this, undefined, handleGuildDelete, globalThis);
const React = tmp2;
const set = new Set();
tmp2.guildIds = set;
const result = size.fileFinishedImporting("stores/GuildMembershipStore.tsx");
2026-07-20 16:05:17 +00:00
export default tmp2;