diff options
author | Syncx <47534062+Syncxv@users.noreply.github.com> | 2023-05-17 12:38:15 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 04:38:15 +0200 |
commit | 1d6b78f6c660f0cd6905552243a3908366a28595 (patch) | |
tree | c8d217a937be8bf2ce39f24e031208388d8f9cb5 /src/webpack/common | |
parent | 341151a71811ddf2a7a36af3dc037135d2b9f7dd (diff) | |
download | Vencord-1d6b78f6c660f0cd6905552243a3908366a28595.tar.gz Vencord-1d6b78f6c660f0cd6905552243a3908366a28595.tar.bz2 Vencord-1d6b78f6c660f0cd6905552243a3908366a28595.zip |
feat(plugin): FavoriteEmojiFirst (#1110)
Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src/webpack/common')
-rw-r--r-- | src/webpack/common/stores.ts | 2 | ||||
-rw-r--r-- | src/webpack/common/types/stores.d.ts | 101 |
2 files changed, 103 insertions, 0 deletions
diff --git a/src/webpack/common/stores.ts b/src/webpack/common/stores.ts index 0bd9e87..f316299 100644 --- a/src/webpack/common/stores.ts +++ b/src/webpack/common/stores.ts @@ -49,6 +49,7 @@ export let RelationshipStore: Stores.RelationshipStore & t.FluxStore & { getSince(userId: string): string; }; +export let EmojiStore: t.EmojiStore; export let WindowStore: t.WindowStore; export const MaskedLinkStore = mapMangledModuleLazy('"MaskedLinkStore"', { @@ -87,3 +88,4 @@ waitForStore("ReadStateStore", m => ReadStateStore = m); waitForStore("GuildChannelStore", m => GuildChannelStore = m); waitForStore("MessageStore", m => MessageStore = m); waitForStore("WindowStore", m => WindowStore = m); +waitForStore("EmojiStore", m => EmojiStore = m); diff --git a/src/webpack/common/types/stores.d.ts b/src/webpack/common/types/stores.d.ts index 6af5b27..db60b63 100644 --- a/src/webpack/common/types/stores.d.ts +++ b/src/webpack/common/types/stores.d.ts @@ -16,6 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +import { Channel } from "discord-types/general"; + import { FluxDispatcher, FluxEvents } from "./utils"; export class FluxStore { @@ -38,3 +40,102 @@ export class WindowStore extends FluxStore { isFocused(): boolean; windowSize(): Record<"width" | "height", number>; } + +type Emoji = CustomEmoji | UnicodeEmoji; +export interface CustomEmoji { + allNamesString: string; + animated: boolean; + available: boolean; + guildId: string; + id: string; + managed: boolean; + name: string; + originalName?: string; + require_colons: boolean; + roles: string[]; + url: string; +} + +export interface UnicodeEmoji { + diversityChildren: Record<any, any>; + emojiObject: { + names: string[]; + surrogates: string; + unicodeVersion: number; + }; + index: number; + surrogates: string; + uniqueName: string; + useSpriteSheet: boolean; + get allNamesString(): string; + get animated(): boolean; + get defaultDiversityChild(): any; + get hasDiversity(): boolean | undefined; + get hasDiversityParent(): boolean | undefined; + get hasMultiDiversity(): boolean | undefined; + get hasMultiDiversityParent(): boolean | undefined; + get managed(): boolean; + get name(): string; + get names(): string[]; + get optionallyDiverseSequence(): string | undefined; + get unicodeVersion(): number; + get url(): string; +} + +export class EmojiStore extends FluxStore { + getCustomEmojiById(id?: string | null): CustomEmoji; + getUsableCustomEmojiById(id?: string | null): CustomEmoji; + getGuilds(): Record<string, { + id: string; + _emojiMap: Record<string, CustomEmoji>; + _emojis: CustomEmoji[]; + get emojis(): CustomEmoji[]; + get rawEmojis(): CustomEmoji[]; + _usableEmojis: CustomEmoji[]; + get usableEmojis(): CustomEmoji[]; + _emoticons: any[]; + get emoticons(): any[]; + }>; + getGuildEmoji(guildId?: string | null): CustomEmoji[]; + getNewlyAddedEmoji(guildId?: string | null): CustomEmoji[]; + getTopEmoji(guildId?: string | null): CustomEmoji[]; + getTopEmojisMetadata(guildId?: string | null): { + emojiIds: string[]; + topEmojisTTL: number; + }; + hasPendingUsage(): boolean; + hasUsableEmojiInAnyGuild(): boolean; + searchWithoutFetchingLatest(data: any): any; + getSearchResultsOrder(...args: any[]): any; + getState(): { + pendingUsages: { key: string, timestamp: number; }[]; + }; + searchWithoutFetchingLatest(data: { + channel: Channel, + query: string; + count?: number; + intention: number; + includeExternalGuilds?: boolean; + matchComparator?(name: string): boolean; + }): Record<"locked" | "unlocked", Emoji[]>; + + getDisambiguatedEmojiContext(): { + backfillTopEmojis: Record<any, any>; + customEmojis: Record<string, CustomEmoji>; + emojisById: Record<string, CustomEmoji>; + emojisByName: Record<string, CustomEmoji>; + emoticonRegex: RegExp | null; + emoticonsByName: Record<string, any>; + escapedEmoticonNames: string; + favoriteNamesAndIds?: any; + favorites?: any; + frequentlyUsed?: any; + groupedCustomEmojis: Record<string, CustomEmoji[]>; + guildId?: string; + isFavoriteEmojiWithoutFetchingLatest(e: Emoji): boolean; + newlyAddedEmoji: Record<string, CustomEmoji[]>; + topEmojis?: any; + unicodeAliases: Record<string, string>; + get favoriteEmojisWithoutFetchingLatest(): Emoji[]; + }; +} |