@vencord/types 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +11 -0
  2. package/dist/Vencord.d.ts +28 -0
  3. package/dist/VencordNative.d.ts +14 -0
  4. package/dist/api/Badges.d.ts +62 -0
  5. package/dist/api/Commands/commandHelpers.d.ts +20 -0
  6. package/dist/api/Commands/index.d.ts +26 -0
  7. package/dist/api/Commands/types.d.ts +74 -0
  8. package/dist/api/ContextMenu.d.ts +57 -0
  9. package/dist/api/DataStore/index.d.ts +96 -0
  10. package/dist/api/MemberListDecorators.d.ts +33 -0
  11. package/dist/api/MessageAccessories.d.ts +10 -0
  12. package/dist/api/MessageDecorations.d.ts +34 -0
  13. package/dist/api/MessageEvents.d.ts +39 -0
  14. package/dist/api/MessagePopover.d.ts +16 -0
  15. package/dist/api/Notices.d.ts +5 -0
  16. package/dist/api/Notifications/NotificationComponent.d.ts +7 -0
  17. package/dist/api/Notifications/Notifications.d.ts +25 -0
  18. package/dist/api/Notifications/index.d.ts +1 -0
  19. package/dist/api/Notifications/notificationLog.d.ts +15 -0
  20. package/dist/api/ServerList.d.ts +8 -0
  21. package/dist/api/SettingsStore.d.ts +28 -0
  22. package/dist/api/Styles.d.ts +97 -0
  23. package/dist/api/index.d.ts +86 -0
  24. package/dist/api/settings.d.ts +76 -0
  25. package/dist/components/Badge.d.ts +5 -0
  26. package/dist/components/CheckedTextInput.d.ts +23 -0
  27. package/dist/components/DonateButton.d.ts +2 -0
  28. package/dist/components/ErrorBoundary.d.ts +26 -0
  29. package/dist/components/ErrorCard.d.ts +3 -0
  30. package/dist/components/Flex.d.ts +6 -0
  31. package/dist/components/Heart.d.ts +2 -0
  32. package/dist/components/Link.d.ts +6 -0
  33. package/dist/components/Monaco.d.ts +1 -0
  34. package/dist/components/PatchHelper.d.ts +3 -0
  35. package/dist/components/PluginSettings/PluginModal.d.ts +9 -0
  36. package/dist/components/PluginSettings/components/SettingBooleanComponent.d.ts +4 -0
  37. package/dist/components/PluginSettings/components/SettingCustomComponent.d.ts +4 -0
  38. package/dist/components/PluginSettings/components/SettingNumericComponent.d.ts +4 -0
  39. package/dist/components/PluginSettings/components/SettingSelectComponent.d.ts +4 -0
  40. package/dist/components/PluginSettings/components/SettingSliderComponent.d.ts +5 -0
  41. package/dist/components/PluginSettings/components/SettingTextComponent.d.ts +4 -0
  42. package/dist/components/PluginSettings/components/index.d.ts +19 -0
  43. package/dist/components/PluginSettings/index.d.ts +4 -0
  44. package/dist/components/Switch.d.ts +9 -0
  45. package/dist/components/VencordSettings/BackupRestoreTab.d.ts +3 -0
  46. package/dist/components/VencordSettings/CloudTab.d.ts +3 -0
  47. package/dist/components/VencordSettings/PluginsTab.d.ts +3 -0
  48. package/dist/components/VencordSettings/ThemesTab.d.ts +3 -0
  49. package/dist/components/VencordSettings/Updater.d.ts +3 -0
  50. package/dist/components/VencordSettings/VencordTab.d.ts +3 -0
  51. package/dist/components/VencordSettings/index.d.ts +7 -0
  52. package/dist/components/handleComponentFailed.d.ts +1 -0
  53. package/dist/components/index.d.ts +3 -0
  54. package/dist/globals.d.ts +72 -0
  55. package/dist/modules.d.ts +46 -0
  56. package/dist/plugins/alwaysAnimate.d.ts +17 -0
  57. package/dist/plugins/alwaysTrust.d.ts +16 -0
  58. package/dist/plugins/anonymiseFileNames.d.ts +50 -0
  59. package/dist/plugins/apiBadges.d.ts +36 -0
  60. package/dist/plugins/apiCommands.d.ts +28 -0
  61. package/dist/plugins/apiContextMenu.d.ts +25 -0
  62. package/dist/plugins/apiMemberListDecorators.d.ts +16 -0
  63. package/dist/plugins/apiMessageAccessories.d.ts +16 -0
  64. package/dist/plugins/apiMessageDecorations.d.ts +16 -0
  65. package/dist/plugins/apiMessageEvents.d.ts +22 -0
  66. package/dist/plugins/apiMessagePopover.d.ts +16 -0
  67. package/dist/plugins/apiNotices.d.ts +20 -0
  68. package/dist/plugins/apiServerList.d.ts +16 -0
  69. package/dist/plugins/apiSettingsStore.d.ts +16 -0
  70. package/dist/plugins/arRPC.web.d.ts +13 -0
  71. package/dist/plugins/banger.d.ts +25 -0
  72. package/dist/plugins/betterFolders/FolderSideBar.d.ts +3 -0
  73. package/dist/plugins/betterFolders/index.d.ts +71 -0
  74. package/dist/plugins/betterGifAltText.d.ts +17 -0
  75. package/dist/plugins/betterNotes.d.ts +41 -0
  76. package/dist/plugins/betterRoleDot.d.ts +35 -0
  77. package/dist/plugins/betterUploadButton.d.ts +16 -0
  78. package/dist/plugins/blurNsfw.d.ts +28 -0
  79. package/dist/plugins/callTimer.d.ts +40 -0
  80. package/dist/plugins/clearURLs/defaultRules.d.ts +1 -0
  81. package/dist/plugins/clearURLs/index.d.ts +18 -0
  82. package/dist/plugins/colorSighted.d.ts +22 -0
  83. package/dist/plugins/consoleShortcuts.d.ts +47 -0
  84. package/dist/plugins/crashHandler.d.ts +44 -0
  85. package/dist/plugins/customRPC.d.ts +97 -0
  86. package/dist/plugins/devCompanion.dev.d.ts +19 -0
  87. package/dist/plugins/disableDMCallIdle.d.ts +16 -0
  88. package/dist/plugins/emoteCloner.d.ts +11 -0
  89. package/dist/plugins/experiments.d.ts +51 -0
  90. package/dist/plugins/f8break.d.ts +12 -0
  91. package/dist/plugins/fakeNitro.d.ts +140 -0
  92. package/dist/plugins/fakeProfileThemes.d.ts +44 -0
  93. package/dist/plugins/fart.d.ts +34 -0
  94. package/dist/plugins/fixInbox.d.ts +18 -0
  95. package/dist/plugins/forceOwnerCrown.d.ts +17 -0
  96. package/dist/plugins/friendInvites.d.ts +22 -0
  97. package/dist/plugins/fxTwitter.d.ts +14 -0
  98. package/dist/plugins/gameActivityToggle/index.d.ts +21 -0
  99. package/dist/plugins/gifPaste.d.ts +19 -0
  100. package/dist/plugins/hideAttachments.d.ts +14 -0
  101. package/dist/plugins/highResAvatars.d.ts +16 -0
  102. package/dist/plugins/iLoveSpam.d.ts +16 -0
  103. package/dist/plugins/ignoreActivities.d.ts +30 -0
  104. package/dist/plugins/imageZoom/components/Magnifier.d.ts +7 -0
  105. package/dist/plugins/imageZoom/constants.d.ts +1 -0
  106. package/dist/plugins/imageZoom/index.d.ts +122 -0
  107. package/dist/plugins/imageZoom/utils/waitFor.d.ts +1 -0
  108. package/dist/plugins/index.d.ts +13 -0
  109. package/dist/plugins/invisibleChat/components/DecryptionModal.d.ts +3 -0
  110. package/dist/plugins/invisibleChat/components/EncryptionModal.d.ts +1 -0
  111. package/dist/plugins/invisibleChat/index.d.ts +42 -0
  112. package/dist/plugins/keepCurrentChannel.d.ts +30 -0
  113. package/dist/plugins/lastfm.d.ts +90 -0
  114. package/dist/plugins/loadingQuotes.d.ts +18 -0
  115. package/dist/plugins/memberCount.d.ts +26 -0
  116. package/dist/plugins/messageClickActions.d.ts +25 -0
  117. package/dist/plugins/messageLinkEmbeds.d.ts +45 -0
  118. package/dist/plugins/messageLogger/index.d.ts +58 -0
  119. package/dist/plugins/messageTags.d.ts +38 -0
  120. package/dist/plugins/moreCommands.d.ts +26 -0
  121. package/dist/plugins/moreKaomoji.d.ts +18 -0
  122. package/dist/plugins/moreUserTags.d.ts +51 -0
  123. package/dist/plugins/moyai.d.ts +58 -0
  124. package/dist/plugins/muteNewGuild.d.ts +18 -0
  125. package/dist/plugins/noBlockedMessages.d.ts +33 -0
  126. package/dist/plugins/noCanaryMessageLinks.d.ts +29 -0
  127. package/dist/plugins/noDevtoolsWarning.d.ts +16 -0
  128. package/dist/plugins/noF1.d.ts +16 -0
  129. package/dist/plugins/noRPC.discordDesktop.d.ts +16 -0
  130. package/dist/plugins/noReplyMention.d.ts +31 -0
  131. package/dist/plugins/noScreensharePreview.d.ts +16 -0
  132. package/dist/plugins/noSystemBadge.discordDesktop.d.ts +16 -0
  133. package/dist/plugins/noTrack.d.ts +23 -0
  134. package/dist/plugins/noUnblockToJump.d.ts +16 -0
  135. package/dist/plugins/nsfwGateBypass.d.ts +16 -0
  136. package/dist/plugins/oneko.d.ts +11 -0
  137. package/dist/plugins/petpet.d.ts +38 -0
  138. package/dist/plugins/pinDms/contextMenus.d.ts +2 -0
  139. package/dist/plugins/pinDms/index.d.ts +47 -0
  140. package/dist/plugins/pinDms/settings.d.ts +26 -0
  141. package/dist/plugins/plainFolderIcon.d.ts +16 -0
  142. package/dist/plugins/platformIndicators.d.ts +46 -0
  143. package/dist/plugins/pronoundb/components/PronounsAboutComponent.d.ts +2 -0
  144. package/dist/plugins/pronoundb/components/PronounsChatComponent.d.ts +11 -0
  145. package/dist/plugins/pronoundb/components/PronounsProfileWrapper.d.ts +3 -0
  146. package/dist/plugins/pronoundb/index.d.ts +59 -0
  147. package/dist/plugins/pronoundb/pronoundbUtils.d.ts +5 -0
  148. package/dist/plugins/pronoundb/types.d.ts +34 -0
  149. package/dist/plugins/quickMention.d.ts +14 -0
  150. package/dist/plugins/quickReply.d.ts +32 -0
  151. package/dist/plugins/readAllNotificationsButton.d.ts +14 -0
  152. package/dist/plugins/relationshipNotifier/events.d.ts +3 -0
  153. package/dist/plugins/relationshipNotifier/functions.d.ts +7 -0
  154. package/dist/plugins/relationshipNotifier/index.d.ts +53 -0
  155. package/dist/plugins/relationshipNotifier/settings.d.ts +34 -0
  156. package/dist/plugins/relationshipNotifier/types.d.ts +37 -0
  157. package/dist/plugins/relationshipNotifier/utils.d.ts +10 -0
  158. package/dist/plugins/revealAllSpoilers.d.ts +17 -0
  159. package/dist/plugins/reverseImageSearch.d.ts +18 -0
  160. package/dist/plugins/reviewDB/Utils/ReviewDBAPI.d.ts +13 -0
  161. package/dist/plugins/reviewDB/Utils/Utils.d.ts +6 -0
  162. package/dist/plugins/reviewDB/components/MessageButton.d.ts +3 -0
  163. package/dist/plugins/reviewDB/components/ReviewBadge.d.ts +3 -0
  164. package/dist/plugins/reviewDB/components/ReviewComponent.d.ts +7 -0
  165. package/dist/plugins/reviewDB/components/ReviewsView.d.ts +4 -0
  166. package/dist/plugins/reviewDB/entities/Badge.d.ts +7 -0
  167. package/dist/plugins/reviewDB/entities/Review.d.ts +14 -0
  168. package/dist/plugins/reviewDB/index.d.ts +34 -0
  169. package/dist/plugins/roleColorEverywhere.d.ts +63 -0
  170. package/dist/plugins/searchReply.d.ts +11 -0
  171. package/dist/plugins/sendTimestamps/index.d.ts +23 -0
  172. package/dist/plugins/serverListIndicators.d.ts +37 -0
  173. package/dist/plugins/settings.d.ts +61 -0
  174. package/dist/plugins/shikiCodeblocks/api/languages.d.ts +28 -0
  175. package/dist/plugins/shikiCodeblocks/api/shiki.d.ts +51 -0
  176. package/dist/plugins/shikiCodeblocks/api/themes.d.ts +37 -0
  177. package/dist/plugins/shikiCodeblocks/components/ButtonRow.d.ts +6 -0
  178. package/dist/plugins/shikiCodeblocks/components/Code.d.ts +11 -0
  179. package/dist/plugins/shikiCodeblocks/components/CopyButton.d.ts +5 -0
  180. package/dist/plugins/shikiCodeblocks/components/Header.d.ts +9 -0
  181. package/dist/plugins/shikiCodeblocks/components/Highlighter.d.ts +15 -0
  182. package/dist/plugins/shikiCodeblocks/hooks/useCopyCooldown.d.ts +1 -0
  183. package/dist/plugins/shikiCodeblocks/hooks/useShikiSettings.d.ts +16 -0
  184. package/dist/plugins/shikiCodeblocks/hooks/useTheme.d.ts +8 -0
  185. package/dist/plugins/shikiCodeblocks/index.d.ts +132 -0
  186. package/dist/plugins/shikiCodeblocks/previewExample.d.ts +5 -0
  187. package/dist/plugins/shikiCodeblocks/settings.d.ts +58 -0
  188. package/dist/plugins/shikiCodeblocks/types.d.ts +42 -0
  189. package/dist/plugins/shikiCodeblocks/utils/color.d.ts +1 -0
  190. package/dist/plugins/shikiCodeblocks/utils/createStyle.d.ts +3 -0
  191. package/dist/plugins/shikiCodeblocks/utils/misc.d.ts +7 -0
  192. package/dist/plugins/showHiddenChannels/components/HiddenChannelLockScreen.d.ts +34 -0
  193. package/dist/plugins/showHiddenChannels/index.d.ts +110 -0
  194. package/dist/plugins/showMeYourName/index.d.ts +49 -0
  195. package/dist/plugins/silentMessageToggle.d.ts +31 -0
  196. package/dist/plugins/silentTyping.d.ts +59 -0
  197. package/dist/plugins/sortFriendRequests.d.ts +34 -0
  198. package/dist/plugins/spotifyControls/PlayerComponent.d.ts +3 -0
  199. package/dist/plugins/spotifyControls/index.d.ts +33 -0
  200. package/dist/plugins/spotifyCrack.d.ts +38 -0
  201. package/dist/plugins/spotifyShareCommands.d.ts +18 -0
  202. package/dist/plugins/startupTimings/StartupTimingPage.d.ts +3 -0
  203. package/dist/plugins/startupTimings/index.d.ts +18 -0
  204. package/dist/plugins/supportHelper.d.ts +21 -0
  205. package/dist/plugins/timeBarAllActivities.d.ts +16 -0
  206. package/dist/plugins/typingIndicator.d.ts +31 -0
  207. package/dist/plugins/typingTweaks.d.ts +51 -0
  208. package/dist/plugins/unindent.d.ts +22 -0
  209. package/dist/plugins/unminifyErrors.d.ts +19 -0
  210. package/dist/plugins/urbanDictionary.d.ts +24 -0
  211. package/dist/plugins/userVoiceShow/components/VoiceChannelSection.d.ts +10 -0
  212. package/dist/plugins/userVoiceShow/index.d.ts +36 -0
  213. package/dist/plugins/usrbg/index.d.ts +36 -0
  214. package/dist/plugins/uwuify.d.ts +18 -0
  215. package/dist/plugins/vcDoubleClick.d.ts +26 -0
  216. package/dist/plugins/vcNarrator.d.ts +18 -0
  217. package/dist/plugins/viewIcons.d.ts +36 -0
  218. package/dist/plugins/viewRaw.d.ts +12 -0
  219. package/dist/plugins/volumeBooster.discordDesktop.d.ts +38 -0
  220. package/dist/plugins/webContextMenus.web.d.ts +48 -0
  221. package/dist/plugins/welcomeStickerPicker.d.ts +47 -0
  222. package/dist/plugins/whoReacted.d.ts +120 -0
  223. package/dist/plugins/wikisearch.d.ts +23 -0
  224. package/dist/utils/ChangeList.d.ts +10 -0
  225. package/dist/utils/IpcEvents.d.ts +16 -0
  226. package/dist/utils/Logger.d.ts +21 -0
  227. package/dist/utils/Queue.d.ts +33 -0
  228. package/dist/utils/cloud.d.ts +7 -0
  229. package/dist/utils/constants.d.ts +254 -0
  230. package/dist/utils/debounce.d.ts +8 -0
  231. package/dist/utils/dependencies.d.ts +41 -0
  232. package/dist/utils/discord.d.ts +10 -0
  233. package/dist/utils/guards.d.ts +2 -0
  234. package/dist/utils/index.d.ts +30 -0
  235. package/dist/utils/localStorage.d.ts +1 -0
  236. package/dist/utils/margins.d.ts +1 -0
  237. package/dist/utils/misc.d.ts +80 -0
  238. package/dist/utils/modal.d.ts +149 -0
  239. package/dist/utils/native.d.ts +2 -0
  240. package/dist/utils/onceDefined.d.ts +11 -0
  241. package/dist/utils/patches.d.ts +5 -0
  242. package/dist/utils/proxyLazy.d.ts +10 -0
  243. package/dist/utils/quickCss.d.ts +1 -0
  244. package/dist/utils/react.d.ts +7 -0
  245. package/dist/utils/settingsSync.d.ts +7 -0
  246. package/dist/utils/text.d.ts +20 -0
  247. package/dist/utils/types.d.ts +222 -0
  248. package/dist/utils/updater.d.ts +11 -0
  249. package/dist/utils/web.d.ts +1 -0
  250. package/dist/webpack/common/components.d.ts +22 -0
  251. package/dist/webpack/common/index.d.ts +8 -0
  252. package/dist/webpack/common/internal.d.ts +4 -0
  253. package/dist/webpack/common/menu.d.ts +3 -0
  254. package/dist/webpack/common/react.d.ts +8 -0
  255. package/dist/webpack/common/stores.d.ts +37 -0
  256. package/dist/webpack/common/types/i18nMessages.d.ts +2 -0
  257. package/dist/webpack/common/utils.d.ts +47 -0
  258. package/dist/webpack/index.d.ts +2 -0
  259. package/dist/webpack/patchWebpack.d.ts +1 -0
  260. package/dist/webpack/webpack.d.ts +105 -0
  261. package/index.d.ts +5 -0
  262. package/package.json +26 -0
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # Vencord Types
2
+
3
+ Typings for Vencord's api, published to npm
4
+
5
+ ```sh
6
+ npm i @vencord/types
7
+
8
+ yarn add @vencord/types
9
+
10
+ pnpm add @vencord/types
11
+ ```
@@ -0,0 +1,28 @@
1
+ /*!
2
+ * Vencord, a modification for Discord's desktop app
3
+ * Copyright (c) 2022 Vendicated and contributors
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+ export * as Api from "./api";
19
+ export * as Plugins from "./plugins";
20
+ export * as Util from "./utils";
21
+ export * as QuickCss from "./utils/quickCss";
22
+ export * as Updater from "./utils/updater";
23
+ export * as Webpack from "./webpack";
24
+ export { PlainSettings, Settings };
25
+ import "./utils/quickCss";
26
+ import "./webpack/patchWebpack";
27
+ import { PlainSettings, Settings } from "./api/settings";
28
+ export declare let Components: any;
@@ -0,0 +1,14 @@
1
+ /// <reference types="standalone-electron-types" />
2
+ /// <reference types="node" />
3
+ import { IpcRenderer } from "electron";
4
+ declare const _default: {
5
+ getVersions: () => NodeJS.ProcessVersions;
6
+ ipc: {
7
+ send(event: string, ...args: any[]): void;
8
+ sendSync<T = any>(event: string, ...args: any[]): T;
9
+ on(event: string, listener: Parameters<IpcRenderer["on"]>[1]): void;
10
+ off(event: string, listener: Parameters<IpcRenderer["off"]>[1]): void;
11
+ invoke<T_1 = any>(event: string, ...args: any[]): Promise<T_1>;
12
+ };
13
+ };
14
+ export default _default;
@@ -0,0 +1,62 @@
1
+ import { User } from "discord-types/general";
2
+ import { ComponentType, HTMLProps } from "react";
3
+ export declare enum BadgePosition {
4
+ START = 0,
5
+ END = 1
6
+ }
7
+ export interface ProfileBadge {
8
+ /** The tooltip to show on hover. Required for image badges */
9
+ description?: string;
10
+ /** Custom component for the badge (tooltip not included) */
11
+ component?: ComponentType<ProfileBadge & BadgeUserArgs>;
12
+ /** The custom image to use */
13
+ image?: string;
14
+ link?: string;
15
+ /** Action to perform when you click the badge */
16
+ onClick?(): void;
17
+ /** Should the user display this badge? */
18
+ shouldShow?(userInfo: BadgeUserArgs): boolean;
19
+ /** Optional props (e.g. style) for the badge, ignored for component badges */
20
+ props?: HTMLProps<HTMLImageElement>;
21
+ /** Insert at start or end? */
22
+ position?: BadgePosition;
23
+ /** The badge name to display, Discord uses this. Required for component badges */
24
+ key?: string;
25
+ }
26
+ /**
27
+ * Register a new badge with the Badges API
28
+ * @param badge The badge to register
29
+ */
30
+ export declare function addBadge(badge: ProfileBadge): void;
31
+ /**
32
+ * Unregister a badge from the Badges API
33
+ * @param badge The badge to remove
34
+ */
35
+ export declare function removeBadge(badge: ProfileBadge): boolean;
36
+ /**
37
+ * Inject badges into the profile badges array.
38
+ * You probably don't need to use this.
39
+ */
40
+ export declare function _getBadges(args: BadgeUserArgs): ProfileBadge[];
41
+ export interface BadgeUserArgs {
42
+ user: User;
43
+ profile: Profile;
44
+ premiumSince: Date;
45
+ premiumGuildSince?: Date;
46
+ }
47
+ interface ConnectedAccount {
48
+ type: string;
49
+ id: string;
50
+ name: string;
51
+ verified: boolean;
52
+ }
53
+ interface Profile {
54
+ connectedAccounts: ConnectedAccount[];
55
+ premiumType: number;
56
+ premiumSince: string;
57
+ premiumGuildSince?: any;
58
+ lastFetched: number;
59
+ profileFetchFailed: boolean;
60
+ application?: any;
61
+ }
62
+ export {};
@@ -0,0 +1,20 @@
1
+ import { Message } from "discord-types/general";
2
+ import type { PartialDeep } from "type-fest";
3
+ import { Argument } from "./types";
4
+ export declare function generateId(): string;
5
+ /**
6
+ * Send a message as Clyde
7
+ * @param {string} channelId ID of channel to send message to
8
+ * @param {Message} message Message to send
9
+ * @returns {Message}
10
+ */
11
+ export declare function sendBotMessage(channelId: string, message: PartialDeep<Message>): Message;
12
+ /**
13
+ * Get the value of an option by name
14
+ * @param args Arguments array (first argument passed to execute)
15
+ * @param name Name of the argument
16
+ * @param fallbackValue Fallback value in case this option wasn't passed
17
+ * @returns Value
18
+ */
19
+ export declare function findOption<T>(args: Argument[], name: string): T & {} | undefined;
20
+ export declare function findOption<T>(args: Argument[], name: string, fallbackValue: T): T & {};
@@ -0,0 +1,26 @@
1
+ import { Command, Option } from "./types";
2
+ export * from "./commandHelpers";
3
+ export * from "./types";
4
+ export declare let BUILT_IN: Command[];
5
+ export declare const commands: Record<string, Command>;
6
+ /**
7
+ * Optional message option named "message" you can use in commands.
8
+ * Used in "tableflip" or "shrug"
9
+ * @see {@link RequiredMessageOption}
10
+ */
11
+ export declare let OptionalMessageOption: Option;
12
+ /**
13
+ * Required message option named "message" you can use in commands.
14
+ * Used in "me"
15
+ * @see {@link OptionalMessageOption}
16
+ */
17
+ export declare let RequiredMessageOption: Option;
18
+ export declare const _init: never;
19
+ export declare const _handleCommand: never;
20
+ /**
21
+ * Prepare a Command Option for Discord by filling missing fields
22
+ * @param opt
23
+ */
24
+ export declare function prepareOption<O extends Option | Command>(opt: O): O;
25
+ export declare function registerCommand<C extends Command>(command: C, plugin: string): void;
26
+ export declare function unregisterCommand(name: string): boolean;
@@ -0,0 +1,74 @@
1
+ import { Channel, Guild } from "discord-types/general";
2
+ import { Promisable } from "type-fest";
3
+ export interface CommandContext {
4
+ channel: Channel;
5
+ guild?: Guild;
6
+ }
7
+ export declare enum ApplicationCommandOptionType {
8
+ SUB_COMMAND = 1,
9
+ SUB_COMMAND_GROUP = 2,
10
+ STRING = 3,
11
+ INTEGER = 4,
12
+ BOOLEAN = 5,
13
+ USER = 6,
14
+ CHANNEL = 7,
15
+ ROLE = 8,
16
+ MENTIONABLE = 9,
17
+ NUMBER = 10,
18
+ ATTACHMENT = 11
19
+ }
20
+ export declare enum ApplicationCommandInputType {
21
+ BUILT_IN = 0,
22
+ BUILT_IN_TEXT = 1,
23
+ BUILT_IN_INTEGRATION = 2,
24
+ BOT = 3,
25
+ PLACEHOLDER = 4
26
+ }
27
+ export interface Option {
28
+ name: string;
29
+ displayName?: string;
30
+ type: ApplicationCommandOptionType;
31
+ description: string;
32
+ displayDescription?: string;
33
+ required?: boolean;
34
+ options?: Option[];
35
+ choices?: Array<ChoicesOption>;
36
+ }
37
+ export interface ChoicesOption {
38
+ label: string;
39
+ value: string;
40
+ name: string;
41
+ displayName?: string;
42
+ }
43
+ export declare enum ApplicationCommandType {
44
+ CHAT_INPUT = 1,
45
+ USER = 2,
46
+ MESSAGE = 3
47
+ }
48
+ export interface CommandReturnValue {
49
+ content: string;
50
+ /** TODO: implement */
51
+ cancel?: boolean;
52
+ }
53
+ export interface Argument {
54
+ type: ApplicationCommandOptionType;
55
+ name: string;
56
+ value: string;
57
+ focused: undefined;
58
+ options: Argument[];
59
+ }
60
+ export interface Command {
61
+ id?: string;
62
+ applicationId?: string;
63
+ type?: ApplicationCommandType;
64
+ inputType?: ApplicationCommandInputType;
65
+ plugin?: string;
66
+ isVencordCommand?: boolean;
67
+ name: string;
68
+ displayName?: string;
69
+ description: string;
70
+ displayDescription?: string;
71
+ options?: Option[];
72
+ predicate?(ctx: CommandContext): boolean;
73
+ execute(args: Argument[], ctx: CommandContext): Promisable<void | CommandReturnValue>;
74
+ }
@@ -0,0 +1,57 @@
1
+ import type { ReactElement } from "react";
2
+ type ContextMenuPatchCallbackReturn = (() => void) | void;
3
+ /**
4
+ * @param children The rendered context menu elements
5
+ * @param args Any arguments passed into making the context menu, like the guild, channel, user or message for example
6
+ * @returns A callback which is only ran once used to modify the context menu elements (Use to avoid duplicates)
7
+ */
8
+ export type NavContextMenuPatchCallback = (children: Array<React.ReactElement>, ...args: Array<any>) => ContextMenuPatchCallbackReturn;
9
+ /**
10
+ * @param navId The navId of the context menu being patched
11
+ * @param children The rendered context menu elements
12
+ * @param args Any arguments passed into making the context menu, like the guild, channel, user or message for example
13
+ * @returns A callback which is only ran once used to modify the context menu elements (Use to avoid duplicates)
14
+ */
15
+ export type GlobalContextMenuPatchCallback = (navId: string, children: Array<React.ReactElement>, ...args: Array<any>) => ContextMenuPatchCallbackReturn;
16
+ export declare const navPatches: Map<string, Set<NavContextMenuPatchCallback>>;
17
+ export declare const globalPatches: Set<GlobalContextMenuPatchCallback>;
18
+ /**
19
+ * Add a context menu patch
20
+ * @param navId The navId(s) for the context menu(s) to patch
21
+ * @param patch The patch to be applied
22
+ */
23
+ export declare function addContextMenuPatch(navId: string | Array<string>, patch: NavContextMenuPatchCallback): void;
24
+ /**
25
+ * Add a global context menu patch that fires the patch for all context menus
26
+ * @param patch The patch to be applied
27
+ */
28
+ export declare function addGlobalContextMenuPatch(patch: GlobalContextMenuPatchCallback): void;
29
+ /**
30
+ * Remove a context menu patch
31
+ * @param navId The navId(s) for the context menu(s) to remove the patch
32
+ * @param patch The patch to be removed
33
+ * @returns Wheter the patch was sucessfully removed from the context menu(s)
34
+ */
35
+ export declare function removeContextMenuPatch<T extends string | Array<string>>(navId: T, patch: NavContextMenuPatchCallback): T extends string ? boolean : Array<boolean>;
36
+ /**
37
+ * Remove a global context menu patch
38
+ * @param patch The patch to be removed
39
+ * @returns Wheter the patch was sucessfully removed
40
+ */
41
+ export declare function removeGlobalContextMenuPatch(patch: GlobalContextMenuPatchCallback): boolean;
42
+ /**
43
+ * A helper function for finding the children array of a group nested inside a context menu based on the id of one of its childs
44
+ * @param id The id of the child
45
+ * @param children The context menu children
46
+ */
47
+ export declare function findGroupChildrenByChildId(id: string, children: Array<React.ReactElement>, _itemsArray?: Array<React.ReactElement>): Array<React.ReactElement> | null;
48
+ interface ContextMenuProps {
49
+ contextMenuApiArguments?: Array<any>;
50
+ navId: string;
51
+ children: Array<ReactElement>;
52
+ "aria-label": string;
53
+ onSelect: (() => void) | undefined;
54
+ onClose: (callback: (...args: Array<any>) => any) => void;
55
+ }
56
+ export declare function _patchContextMenu(props: ContextMenuProps): void;
57
+ export {};
@@ -0,0 +1,96 @@
1
+ /*!
2
+ * idb-keyval v6.2.0
3
+ * Copyright 2016, Jake Archibald
4
+ * Copyright 2022, Vendicated
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ export declare function promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T>;
19
+ export declare function createStore(dbName: string, storeName: string): UseStore;
20
+ export type UseStore = <T>(txMode: IDBTransactionMode, callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;
21
+ /**
22
+ * Get a value by its key.
23
+ *
24
+ * @param key
25
+ * @param customStore Method to get a custom store. Use with caution (see the docs).
26
+ */
27
+ export declare function get<T = any>(key: IDBValidKey, customStore?: UseStore): Promise<T | undefined>;
28
+ /**
29
+ * Set a value with a key.
30
+ *
31
+ * @param key
32
+ * @param value
33
+ * @param customStore Method to get a custom store. Use with caution (see the docs).
34
+ */
35
+ export declare function set(key: IDBValidKey, value: any, customStore?: UseStore): Promise<void>;
36
+ /**
37
+ * Set multiple values at once. This is faster than calling set() multiple times.
38
+ * It's also atomic – if one of the pairs can't be added, none will be added.
39
+ *
40
+ * @param entries Array of entries, where each entry is an array of `[key, value]`.
41
+ * @param customStore Method to get a custom store. Use with caution (see the docs).
42
+ */
43
+ export declare function setMany(entries: [IDBValidKey, any][], customStore?: UseStore): Promise<void>;
44
+ /**
45
+ * Get multiple values by their keys
46
+ *
47
+ * @param keys
48
+ * @param customStore Method to get a custom store. Use with caution (see the docs).
49
+ */
50
+ export declare function getMany<T = any>(keys: IDBValidKey[], customStore?: UseStore): Promise<T[]>;
51
+ /**
52
+ * Update a value. This lets you see the old value and update it as an atomic operation.
53
+ *
54
+ * @param key
55
+ * @param updater A callback that takes the old value and returns a new value.
56
+ * @param customStore Method to get a custom store. Use with caution (see the docs).
57
+ */
58
+ export declare function update<T = any>(key: IDBValidKey, updater: (oldValue: T | undefined) => T, customStore?: UseStore): Promise<void>;
59
+ /**
60
+ * Delete a particular key from the store.
61
+ *
62
+ * @param key
63
+ * @param customStore Method to get a custom store. Use with caution (see the docs).
64
+ */
65
+ export declare function del(key: IDBValidKey, customStore?: UseStore): Promise<void>;
66
+ /**
67
+ * Delete multiple keys at once.
68
+ *
69
+ * @param keys List of keys to delete.
70
+ * @param customStore Method to get a custom store. Use with caution (see the docs).
71
+ */
72
+ export declare function delMany(keys: IDBValidKey[], customStore?: UseStore): Promise<void>;
73
+ /**
74
+ * Clear all values in the store.
75
+ *
76
+ * @param customStore Method to get a custom store. Use with caution (see the docs).
77
+ */
78
+ export declare function clear(customStore?: UseStore): Promise<void>;
79
+ /**
80
+ * Get all keys in the store.
81
+ *
82
+ * @param customStore Method to get a custom store. Use with caution (see the docs).
83
+ */
84
+ export declare function keys<KeyType extends IDBValidKey>(customStore?: UseStore): Promise<KeyType[]>;
85
+ /**
86
+ * Get all values in the store.
87
+ *
88
+ * @param customStore Method to get a custom store. Use with caution (see the docs).
89
+ */
90
+ export declare function values<T = any>(customStore?: UseStore): Promise<T[]>;
91
+ /**
92
+ * Get all entries in the store. Each entry is an array of `[key, value]`.
93
+ *
94
+ * @param customStore Method to get a custom store. Use with caution (see the docs).
95
+ */
96
+ export declare function entries<KeyType extends IDBValidKey, ValueType = any>(customStore?: UseStore): Promise<[KeyType, ValueType][]>;
@@ -0,0 +1,33 @@
1
+ /// <reference types="react" />
2
+ import { Channel, User } from "discord-types/general/index.js";
3
+ interface DecoratorProps {
4
+ activities: any[];
5
+ canUseAvatarDecorations: boolean;
6
+ channel: Channel;
7
+ /**
8
+ * Only for DM members
9
+ */
10
+ channelName?: string;
11
+ /**
12
+ * Only for server members
13
+ */
14
+ currentUser?: User;
15
+ guildId?: string;
16
+ isMobile: boolean;
17
+ isOwner?: boolean;
18
+ isTyping: boolean;
19
+ selected: boolean;
20
+ status: string;
21
+ user: User;
22
+ [key: string]: any;
23
+ }
24
+ export type Decorator = (props: DecoratorProps) => JSX.Element | null;
25
+ type OnlyIn = "guilds" | "dms";
26
+ export declare const decorators: Map<string, {
27
+ decorator: Decorator;
28
+ onlyIn?: OnlyIn | undefined;
29
+ }>;
30
+ export declare function addDecorator(identifier: string, decorator: Decorator, onlyIn?: OnlyIn): void;
31
+ export declare function removeDecorator(identifier: string): void;
32
+ export declare function __addDecoratorsToList(props: DecoratorProps): (JSX.Element | null)[];
33
+ export {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ export type AccessoryCallback = (props: Record<string, any>) => JSX.Element | null | Array<JSX.Element | null>;
3
+ export type Accessory = {
4
+ callback: AccessoryCallback;
5
+ position?: number;
6
+ };
7
+ export declare const accessories: Map<String, Accessory>;
8
+ export declare function addAccessory(identifier: string, callback: AccessoryCallback, position?: number): void;
9
+ export declare function removeAccessory(identifier: string): void;
10
+ export declare function _modifyAccessories(elements: JSX.Element[], props: Record<string, any>): JSX.Element[];
@@ -0,0 +1,34 @@
1
+ /// <reference types="react" />
2
+ import { Channel, Message } from "discord-types/general/index.js";
3
+ interface DecorationProps {
4
+ author: {
5
+ /**
6
+ * Will be username if the user has no nickname
7
+ */
8
+ nick: string;
9
+ iconRoleId: string;
10
+ guildMemberAvatar: string;
11
+ colorRoleName: string;
12
+ colorString: string;
13
+ };
14
+ channel: Channel;
15
+ compact: boolean;
16
+ decorations: {
17
+ /**
18
+ * Element for the [BOT] tag if there is one
19
+ */
20
+ 0: JSX.Element | null;
21
+ /**
22
+ * Other decorations (including ones added with this api)
23
+ */
24
+ 1: JSX.Element[];
25
+ };
26
+ message: Message;
27
+ [key: string]: any;
28
+ }
29
+ export type Decoration = (props: DecorationProps) => JSX.Element | null;
30
+ export declare const decorations: Map<string, Decoration>;
31
+ export declare function addDecoration(identifier: string, decoration: Decoration): void;
32
+ export declare function removeDecoration(identifier: string): void;
33
+ export declare function __addDecorationsToMessage(props: DecorationProps): (JSX.Element | null)[];
34
+ export {};
@@ -0,0 +1,39 @@
1
+ import type { Channel, Message } from "discord-types/general";
2
+ import type { Promisable } from "type-fest";
3
+ export interface Emoji {
4
+ require_colons: boolean;
5
+ originalName: string;
6
+ animated: boolean;
7
+ guildId: string;
8
+ name: string;
9
+ url: string;
10
+ id: string;
11
+ }
12
+ export interface MessageObject {
13
+ content: string;
14
+ validNonShortcutEmojis: Emoji[];
15
+ }
16
+ export interface MessageExtra {
17
+ stickerIds?: string[];
18
+ }
19
+ export type SendListener = (channelId: string, messageObj: MessageObject, extra: MessageExtra) => Promisable<void | {
20
+ cancel: boolean;
21
+ }>;
22
+ export type EditListener = (channelId: string, messageId: string, messageObj: MessageObject) => Promisable<void>;
23
+ export declare function _handlePreSend(channelId: string, messageObj: MessageObject, extra: MessageExtra): Promise<boolean>;
24
+ export declare function _handlePreEdit(channelId: string, messageId: string, messageObj: MessageObject): Promise<void>;
25
+ /**
26
+ * Note: This event fires off before a message is sent, allowing you to edit the message.
27
+ */
28
+ export declare function addPreSendListener(listener: SendListener): SendListener;
29
+ /**
30
+ * Note: This event fires off before a message's edit is applied, allowing you to further edit the message.
31
+ */
32
+ export declare function addPreEditListener(listener: EditListener): EditListener;
33
+ export declare function removePreSendListener(listener: SendListener): boolean;
34
+ export declare function removePreEditListener(listener: EditListener): boolean;
35
+ type ClickListener = (message: Message, channel: Channel, event: MouseEvent) => void;
36
+ export declare function _handleClick(message: Message, channel: Channel, event: MouseEvent): void;
37
+ export declare function addClickListener(listener: ClickListener): ClickListener;
38
+ export declare function removeClickListener(listener: ClickListener): boolean;
39
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Channel, Message } from "discord-types/general";
2
+ import type { MouseEventHandler } from "react";
3
+ export interface ButtonItem {
4
+ key?: string;
5
+ label: string;
6
+ icon: React.ComponentType<any>;
7
+ message: Message;
8
+ channel: Channel;
9
+ onClick?: MouseEventHandler<HTMLButtonElement>;
10
+ onContextMenu?: MouseEventHandler<HTMLButtonElement>;
11
+ }
12
+ export type getButtonItem = (message: Message) => ButtonItem | null;
13
+ export declare const buttons: Map<string, getButtonItem>;
14
+ export declare function addButton(identifier: string, item: getButtonItem): void;
15
+ export declare function removeButton(identifier: string): void;
16
+ export declare function _buildPopoverElements(msg: Message, makeButton: (item: ButtonItem) => React.ComponentType): import("react").ComponentType<{}>[];
@@ -0,0 +1,5 @@
1
+ export declare const noticesQueue: any[];
2
+ export declare let currentNotice: any;
3
+ export declare function popNotice(): void;
4
+ export declare function nextNotice(): void;
5
+ export declare function showNotice(message: string, buttonText: string, onOkClick: () => void): void;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import "./styles.css";
3
+ import { NotificationData } from "./Notifications";
4
+ declare const _default: import("react").FunctionComponent<NotificationData & {
5
+ className?: string | undefined;
6
+ }>;
7
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import type { ReactNode } from "react";
2
+ export interface NotificationData {
3
+ title: string;
4
+ body: string;
5
+ /**
6
+ * Same as body but can be a custom component.
7
+ * Will be used over body if present.
8
+ * Not supported on desktop notifications, those will fall back to body */
9
+ richBody?: ReactNode;
10
+ /** Small icon. This is for things like profile pictures and should be square */
11
+ icon?: string;
12
+ /** Large image. Optimally, this should be around 16x9 but it doesn't matter much. Desktop Notifications might not support this */
13
+ image?: string;
14
+ onClick?(): void;
15
+ onClose?(): void;
16
+ color?: string;
17
+ /** Whether this notification should not have a timeout */
18
+ permanent?: boolean;
19
+ /** Whether this notification should not be persisted in the Notification Log */
20
+ noPersist?: boolean;
21
+ /** Whether this notification should be dismissed when clicked (defaults to true) */
22
+ dismissOnClick?: boolean;
23
+ }
24
+ export declare function requestPermission(): Promise<boolean>;
25
+ export declare function showNotification(data: NotificationData): Promise<void>;
@@ -0,0 +1 @@
1
+ export * from "./Notifications";
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import type { NotificationData } from "./Notifications";
3
+ interface PersistentNotificationData extends Pick<NotificationData, "title" | "body" | "image" | "icon" | "color"> {
4
+ timestamp: number;
5
+ id: string;
6
+ }
7
+ export declare function persistNotification(notification: NotificationData): Promise<void>;
8
+ export declare function deleteNotification(timestamp: number): Promise<void>;
9
+ export declare function useLogs(): readonly [PersistentNotificationData[], boolean];
10
+ export declare function NotificationLog({ log, pending }: {
11
+ log: PersistentNotificationData[];
12
+ pending: boolean;
13
+ }): JSX.Element;
14
+ export declare function openNotificationLogModal(): void;
15
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare enum ServerListRenderPosition {
3
+ Above = 0,
4
+ In = 1
5
+ }
6
+ export declare function addServerListElement(position: ServerListRenderPosition, renderFunction: Function): void;
7
+ export declare function removeServerListElement(position: ServerListRenderPosition, renderFunction: Function): void;
8
+ export declare const renderAll: (position: ServerListRenderPosition) => JSX.Element[];
@@ -0,0 +1,28 @@
1
+ interface Setting<T> {
2
+ /**
3
+ * Get the setting value
4
+ */
5
+ getSetting(): T;
6
+ /**
7
+ * Update the setting value
8
+ * @param value The new value
9
+ */
10
+ updateSetting(value: T | ((old: T) => T)): Promise<void>;
11
+ /**
12
+ * React hook for automatically updating components when the setting is updated
13
+ */
14
+ useSetting(): T;
15
+ settingsStoreApiGroup: string;
16
+ settingsStoreApiName: string;
17
+ }
18
+ /**
19
+ * Get the store for a setting
20
+ * @param group The setting group
21
+ * @param name The name of the setting
22
+ */
23
+ export declare function getSettingStore<T = any>(group: string, name: string): Setting<T> | undefined;
24
+ /**
25
+ * getSettingStore but lazy
26
+ */
27
+ export declare function getSettingStoreLazy<T = any>(group: string, name: string): Setting<T> | undefined;
28
+ export {};