Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
thororen1234 2026-04-07 08:37:27 -04:00
commit a8c1023b4c
No known key found for this signature in database
10 changed files with 73 additions and 121 deletions

View file

@ -9,15 +9,19 @@ export const enum ActivityType {
} }
export const enum ActivityFlags { export const enum ActivityFlags {
INSTANCE = 1, INSTANCE = 1 << 0,
JOIN = 2, JOIN = 1 << 1,
SYNC = 16, /** @deprecated */
PLAY = 32, SPECTATE = 1 << 2,
PARTY_PRIVACY_FRIENDS = 64, /** @deprecated */
PARTY_PRIVACY_VOICE_CHANNEL = 128, JOIN_REQUEST = 1 << 3,
EMBEDDED = 256, SYNC = 1 << 4,
CONTEXTLESS = 512, PLAY = 1 << 5,
SUPPORTS_GATEWAY_ACTIVITY_ACTION_JOIN = 1024, PARTY_PRIVACY_FRIENDS = 1 << 6,
PARTY_PRIVACY_VOICE_CHANNEL = 1 << 7,
EMBEDDED = 1 << 8,
CONTEXTLESS = 1 << 9,
SUPPORTS_GATEWAY_ACTIVITY_ACTION_JOIN = 1 << 10,
} }
export const enum ActivityStatusDisplayType { export const enum ActivityStatusDisplayType {

View file

@ -19,25 +19,23 @@ export const enum CarouselItemType {
} }
export const enum ApplicationFlags { export const enum ApplicationFlags {
EMBEDDED_RELEASED = 2, EMBEDDED_RELEASED = 1 << 1,
EMBEDDED_IAP = 8, EMBEDDED_IAP = 1 << 3,
APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE = 64, APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE = 1 << 6,
GAME_PROFILE_DISABLED = 128, GAME_PROFILE_DISABLED = 1 << 7,
CONTEXTLESS_ACTIVITY = 512, CONTEXTLESS_ACTIVITY = 1 << 9,
SOCIAL_LAYER_INTEGRATION_LIMITED = 1024, SOCIAL_LAYER_INTEGRATION_LIMITED = 1 << 10,
CLOUD_GAMING_DEMO = 2048, CLOUD_GAMING_DEMO = 1 << 11,
GATEWAY_PRESENCE = 4096, GATEWAY_PRESENCE = 1 << 12,
GATEWAY_PRESENCE_LIMITED = 8192, GATEWAY_PRESENCE_LIMITED = 1 << 13,
GATEWAY_GUILD_MEMBERS = 16384, GATEWAY_GUILD_MEMBERS = 1 << 14,
GATEWAY_GUILD_MEMBERS_LIMITED = 32768, GATEWAY_GUILD_MEMBERS_LIMITED = 1 << 15,
EMBEDDED = 131072, EMBEDDED = 1 << 17,
GATEWAY_MESSAGE_CONTENT = 262144, GATEWAY_MESSAGE_CONTENT = 1 << 18,
GATEWAY_MESSAGE_CONTENT_LIMITED = 524288, GATEWAY_MESSAGE_CONTENT_LIMITED = 1 << 19,
EMBEDDED_FIRST_PARTY = 1048576, EMBEDDED_FIRST_PARTY = 1 << 20,
APPLICATION_COMMAND_BADGE = 8388608, APPLICATION_COMMAND_BADGE = 1 << 23,
SOCIAL_LAYER_INTEGRATION = 134217728, SOCIAL_LAYER_INTEGRATION = 1 << 27,
PROMOTED = 536870912, PROMOTED = 1 << 29,
PARTNER = 1073741824, PARTNER = 1 << 30,
PARENT = 8589934592,
DISABLE_RELATIONSHIPS_ACCESS = 17179869184,
} }

View file

@ -28,28 +28,30 @@ export const enum ReadStateType {
} }
export const enum UserFlags { export const enum UserFlags {
STAFF = 1, STAFF = 1 << 0,
PARTNER = 2, PARTNER = 1 << 1,
HYPESQUAD = 4, HYPESQUAD = 1 << 2,
BUG_HUNTER_LEVEL_1 = 8, BUG_HUNTER_LEVEL_1 = 1 << 3,
MFA_SMS = 16, MFA_SMS = 1 << 4,
PREMIUM_PROMO_DISMISSED = 32, PREMIUM_PROMO_DISMISSED = 1 << 5,
HYPESQUAD_ONLINE_HOUSE_1 = 64, HYPESQUAD_ONLINE_HOUSE_1 = 1 << 6,
HYPESQUAD_ONLINE_HOUSE_2 = 128, HYPESQUAD_ONLINE_HOUSE_2 = 1 << 7,
HYPESQUAD_ONLINE_HOUSE_3 = 256, HYPESQUAD_ONLINE_HOUSE_3 = 1 << 8,
PREMIUM_EARLY_SUPPORTER = 512, PREMIUM_EARLY_SUPPORTER = 1 << 9,
HAS_UNREAD_URGENT_MESSAGES = 8192, TEAM_PSEUDO_USER = 1 << 10,
BUG_HUNTER_LEVEL_2 = 16384, IS_HUBSPOT_CONTACT = 1 << 11,
VERIFIED_BOT = 65536, SYSTEM = 1 << 12,
VERIFIED_DEVELOPER = 131072, HAS_UNREAD_URGENT_MESSAGES = 1 << 13,
CERTIFIED_MODERATOR = 262144, BUG_HUNTER_LEVEL_2 = 1 << 14,
BOT_HTTP_INTERACTIONS = 524288, UNDERAGE_DELETED = 1 << 15,
SPAMMER = 1048576, VERIFIED_BOT = 1 << 16,
DISABLE_PREMIUM = 2097152, VERIFIED_DEVELOPER = 1 << 17,
PROVISIONAL_ACCOUNT = 8388608, CERTIFIED_MODERATOR = 1 << 18,
QUARANTINED = 17592186044416, BOT_HTTP_INTERACTIONS = 1 << 19,
COLLABORATOR = 1125899906842624, SPAMMER = 1 << 20,
RESTRICTED_COLLABORATOR = 2251799813685248, DISABLE_PREMIUM = 1 << 21,
ACTIVE_DEVELOPER = 1 << 22,
PROVISIONAL_ACCOUNT = 1 << 23,
} }
export const enum StandingState { export const enum StandingState {

View file

@ -3,7 +3,7 @@
"author": "Equicord & Vencord Contributors", "author": "Equicord & Vencord Contributors",
"private": false, "private": false,
"description": "Typescript definitions for the webpack modules of the Discord Web app", "description": "Typescript definitions for the webpack modules of the Discord Web app",
"version": "1.0.3", "version": "1.0.4",
"license": "LGPL-3.0-or-later", "license": "LGPL-3.0-or-later",
"types": "src/index.d.ts", "types": "src/index.d.ts",
"type": "module", "type": "module",

View file

@ -0,0 +1,7 @@
import { FluxStore } from "..";
export interface ApplicationStreamPreviewStore extends FluxStore {
getIsPreviewLoading: (guildId: string | bigint | null, channelId: string | bigint, ownerId: string | bigint) => boolean;
getPreviewURL: (guildId: string | bigint | null, channelId: string | bigint, ownerId: string | bigint) => Promise<string | null>;
getPreviewURLForStreamKey: (streamKey: string) => ReturnType<ApplicationStreamPreviewStore["getPreviewURL"]>;
}

View file

@ -1,39 +1,4 @@
/* import { ApplicationStream, FluxStore, Stream } from "..";
* Vencord, a modification for Discord's desktop app
* Copyright (c) 2023 Vendicated and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { FluxStore } from "@vencord/discord-types";
export interface ApplicationStreamPreviewStore extends FluxStore {
getIsPreviewLoading: (guildId: string | bigint | null, channelId: string | bigint, ownerId: string | bigint) => boolean;
getPreviewURL: (guildId: string | bigint | null, channelId: string | bigint, ownerId: string | bigint) => Promise<string | null>;
getPreviewURLForStreamKey: (streamKey: string) => ReturnType<ApplicationStreamPreviewStore["getPreviewURL"]>;
}
export interface ApplicationStream {
streamType: string;
guildId: string | null;
channelId: string;
ownerId: string;
}
export interface Stream extends ApplicationStream {
state: string;
}
export interface RTCStream { export interface RTCStream {
region: string, region: string,
@ -54,9 +19,6 @@ export interface StreamingStoreState {
streamsByUserAndGuild: { [key: string]: { [key: string]: ApplicationStream; }; }; streamsByUserAndGuild: { [key: string]: { [key: string]: ApplicationStream; }; };
} }
/**
* example how a stream key could look like: `call(type of connection):1116549917987192913(channelId):305238513941667851(ownerId)`
*/
export interface ApplicationStreamingStore extends FluxStore { export interface ApplicationStreamingStore extends FluxStore {
getActiveStreamForApplicationStream: (stream: ApplicationStream) => Stream | null; getActiveStreamForApplicationStream: (stream: ApplicationStream) => Stream | null;
getActiveStreamForStreamKey: (streamKey: string) => Stream | null; getActiveStreamForStreamKey: (streamKey: string) => Stream | null;

View file

@ -3,6 +3,8 @@ export * from "./AccessibilityStore";
export * from "./ActiveJoinedThreadsStore"; export * from "./ActiveJoinedThreadsStore";
export * from "./ApplicationCommandIndexStore"; export * from "./ApplicationCommandIndexStore";
export * from "./ApplicationStore"; export * from "./ApplicationStore";
export * from "./ApplicationStreamingStore";
export * from "./ApplicationStreamPreviewStore";
export * from "./AuthenticationStore"; export * from "./AuthenticationStore";
export * from "./CallStore"; export * from "./CallStore";
export * from "./ChannelRTCStore"; export * from "./ChannelRTCStore";

View file

@ -21,11 +21,8 @@ import { ScreenshareIcon } from "@components/Icons";
import { Devs } from "@utils/constants"; import { Devs } from "@utils/constants";
import { openImageModal } from "@utils/discord"; import { openImageModal } from "@utils/discord";
import definePlugin from "@utils/types"; import definePlugin from "@utils/types";
import { Channel, User } from "@vencord/discord-types"; import { ApplicationStream, Channel, Stream, User } from "@vencord/discord-types";
import { Menu } from "@webpack/common"; import { ApplicationStreamingStore, ApplicationStreamPreviewStore, Menu } from "@webpack/common";
import { ApplicationStreamingStore, ApplicationStreamPreviewStore } from "./webpack/stores";
import { ApplicationStream, Stream } from "./webpack/types/stores";
export interface UserContextProps { export interface UserContextProps {
channel: Channel, channel: Channel,

View file

@ -1,24 +0,0 @@
/*
* Vencord, a modification for Discord's desktop app
* Copyright (c) 2023 Vendicated and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { findStoreLazy } from "@webpack";
import * as t from "./types/stores";
export const ApplicationStreamPreviewStore: t.ApplicationStreamPreviewStore = findStoreLazy("ApplicationStreamPreviewStore");
export const ApplicationStreamingStore: t.ApplicationStreamingStore = findStoreLazy("ApplicationStreamingStore");

View file

@ -85,6 +85,8 @@ export let EditMessageStore: t.EditMessageStore;
export let QuestStore: t.QuestStore; export let QuestStore: t.QuestStore;
export let ExperimentStore: t.ExperimentStore; export let ExperimentStore: t.ExperimentStore;
export let UserAffinitiesStore: t.UserAffinitiesStore; export let UserAffinitiesStore: t.UserAffinitiesStore;
export let ApplicationStreamingStore: t.ApplicationStreamingStore;
export let ApplicationStreamPreviewStore: t.ApplicationStreamPreviewStore;
/** /**
* @see jsdoc of {@link t.useStateFromStores} * @see jsdoc of {@link t.useStateFromStores}
@ -142,6 +144,8 @@ waitForStore("EditMessageStore", m => EditMessageStore = m);
waitForStore("ExperimentStore", m => ExperimentStore = m); waitForStore("ExperimentStore", m => ExperimentStore = m);
waitForStore("QuestStore", m => QuestStore = m); waitForStore("QuestStore", m => QuestStore = m);
waitForStore("UserAffinitiesV2Store", m => UserAffinitiesStore = m); waitForStore("UserAffinitiesV2Store", m => UserAffinitiesStore = m);
waitForStore("ApplicationStreamingStore", m => ApplicationStreamingStore = m);
waitForStore("ApplicationStreamPreviewStore", m => ApplicationStreamPreviewStore = m);
waitForStore("ThemeStore", m => { waitForStore("ThemeStore", m => {
ThemeStore = m; ThemeStore = m;
// Importing this directly causes all webpack commons to be imported, which can easily cause circular dependencies. // Importing this directly causes all webpack commons to be imported, which can easily cause circular dependencies.