@vencord/types 1.13.2 → 1.14.1

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 (136) hide show
  1. package/Vencord.d.ts +1 -4
  2. package/VencordNative.d.ts +6 -2
  3. package/api/Badges.d.ts +3 -2
  4. package/api/ChatButtons.d.ts +23 -5
  5. package/api/MessagePopover.d.ts +15 -2
  6. package/{plugins/index.d.ts → api/PluginManager.d.ts} +4 -3
  7. package/api/Settings.d.ts +14 -1
  8. package/{utils/cloud.d.ts → api/SettingsSync/cloudSetup.d.ts} +2 -2
  9. package/api/SettingsSync/cloudSync.d.ts +5 -0
  10. package/{utils/settingsSync.d.ts → api/SettingsSync/offline.d.ts} +0 -3
  11. package/api/Styles.d.ts +20 -30
  12. package/api/Themes.d.ts +2 -0
  13. package/api/index.d.ts +6 -0
  14. package/components/BaseText.d.ts +34 -0
  15. package/components/Button.d.ts +21 -0
  16. package/components/Card.d.ts +8 -0
  17. package/components/CodeBlock.d.ts +6 -0
  18. package/components/Divider.d.ts +4 -0
  19. package/components/ErrorBoundary.d.ts +3 -1
  20. package/components/Flex.d.ts +9 -5
  21. package/components/FormSwitch.d.ts +1 -2
  22. package/components/Heading.d.ts +15 -0
  23. package/components/Icons.d.ts +13 -0
  24. package/components/Paragraph.d.ts +3 -0
  25. package/components/Span.d.ts +3 -0
  26. package/components/Switch.d.ts +2 -3
  27. package/components/TooltipContainer.d.ts +4 -0
  28. package/components/TooltipFallback.d.ts +3 -0
  29. package/components/index.d.ts +8 -1
  30. package/components/margins.d.ts +7 -0
  31. package/components/settings/tabs/BaseTab.d.ts +2 -3
  32. package/components/settings/tabs/index.d.ts +1 -1
  33. package/components/settings/tabs/plugins/PluginCard.d.ts +0 -1
  34. package/components/settings/tabs/plugins/UIElements.d.ts +2 -0
  35. package/components/settings/tabs/plugins/components/Common.d.ts +3 -2
  36. package/components/settings/tabs/plugins/index.d.ts +1 -1
  37. package/components/settings/tabs/updater/index.d.ts +0 -1
  38. package/package.json +1 -1
  39. package/plugins/_api/badges/index.d.ts +5 -10
  40. package/plugins/_api/messagePopover.d.ts +1 -1
  41. package/plugins/_api/notices.d.ts +0 -6
  42. package/plugins/_core/settings.d.ts +62 -28
  43. package/plugins/alwaysExpandRoles/index.d.ts +1 -1
  44. package/plugins/betterSessions/components/RenameModal.d.ts +1 -1
  45. package/plugins/betterSessions/index.d.ts +1 -0
  46. package/plugins/betterSettings/index.d.ts +20 -16
  47. package/plugins/customRPC/RpcSettings.d.ts +2 -0
  48. package/plugins/customRPC/index.d.ts +72 -247
  49. package/plugins/decor/index.d.ts +2 -3
  50. package/plugins/decor/lib/stores/UsersDecorationsStore.d.ts +1 -1
  51. package/plugins/decor/lib/utils/decoration.d.ts +1 -1
  52. package/plugins/decor/ui/components/DecorDecorationGridDecoration.d.ts +1 -1
  53. package/plugins/decor/ui/components/index.d.ts +1 -1
  54. package/plugins/decor/ui/index.d.ts +2 -2
  55. package/plugins/experiments/index.d.ts +4 -4
  56. package/plugins/fakeNitro/index.d.ts +3 -3
  57. package/plugins/fakeProfileThemes/index.d.ts +2 -2
  58. package/plugins/fixImagesQuality/index.d.ts +23 -0
  59. package/plugins/fixSpotifyEmbeds.desktop/index.d.ts +9 -1
  60. package/plugins/friendsSince/index.d.ts +1 -0
  61. package/plugins/gameActivityToggle/index.d.ts +29 -0
  62. package/plugins/hideAttachments/index.d.ts +11 -9
  63. package/plugins/ignoreActivities/index.d.ts +2 -4
  64. package/plugins/lastfmRichPresence/index.d.ts +11 -11
  65. package/plugins/memberCount/OnlineMemberCountStore.d.ts +3 -3
  66. package/plugins/memberCount/index.d.ts +1 -4
  67. package/plugins/moreQuickReactions/index.d.ts +31 -0
  68. package/plugins/noServerEmojis/index.d.ts +2 -1
  69. package/plugins/permissionsViewer/index.d.ts +3 -2
  70. package/plugins/permissionsViewer/utils.d.ts +1 -1
  71. package/plugins/petpet/index.d.ts +1 -1
  72. package/plugins/plainFolderIcon/index.d.ts +1 -1
  73. package/plugins/previewMessage/index.d.ts +5 -2
  74. package/plugins/quickMention/index.d.ts +15 -8
  75. package/plugins/relationshipNotifier/types.d.ts +0 -6
  76. package/plugins/replaceGoogleSearch/index.d.ts +28 -0
  77. package/plugins/reviewDB/utils.d.ts +1 -1
  78. package/plugins/roleColorEverywhere/index.d.ts +9 -2
  79. package/plugins/sendTimestamps/index.d.ts +5 -2
  80. package/plugins/shikiCodeblocks.desktop/api/languages.d.ts +6 -8
  81. package/plugins/shikiCodeblocks.desktop/api/shiki.d.ts +7 -1
  82. package/plugins/shikiCodeblocks.desktop/api/themes.d.ts +7 -1
  83. package/plugins/shikiCodeblocks.desktop/index.d.ts +9 -3
  84. package/plugins/shikiCodeblocks.desktop/settings.d.ts +3 -3
  85. package/plugins/shikiCodeblocks.desktop/utils/misc.d.ts +1 -1
  86. package/plugins/showHiddenChannels/index.d.ts +1 -1
  87. package/plugins/showHiddenThings/index.d.ts +7 -0
  88. package/plugins/showTimeoutDuration/index.d.ts +3 -3
  89. package/plugins/silentMessageToggle/index.d.ts +5 -2
  90. package/plugins/silentTyping/index.d.ts +5 -2
  91. package/plugins/spotifyControls/SpotifyStore.d.ts +5 -4
  92. package/plugins/superReactionTweaks/index.d.ts +2 -7
  93. package/plugins/themeAttributes/index.d.ts +4 -0
  94. package/plugins/translate/TranslateIcon.d.ts +2 -5
  95. package/plugins/translate/index.d.ts +14 -19
  96. package/plugins/translate/settings.d.ts +0 -10
  97. package/plugins/translate/utils.d.ts +1 -1
  98. package/plugins/userVoiceShow/index.d.ts +2 -9
  99. package/plugins/usrbg/index.d.ts +7 -0
  100. package/plugins/vencordToolbox/index.d.ts +32 -2
  101. package/plugins/vencordToolbox/menu.d.ts +4 -0
  102. package/plugins/viewIcons/index.d.ts +1 -3
  103. package/plugins/viewRaw/index.d.ts +11 -8
  104. package/plugins/voiceMessages/index.d.ts +1 -0
  105. package/plugins/voiceMessages/native.d.ts +1 -1
  106. package/plugins/webScreenShareFixes.web/index.d.ts +15 -0
  107. package/shared/IpcEvents.d.ts +6 -5
  108. package/shared/SettingsStore.d.ts +17 -3
  109. package/utils/apng.d.ts +46 -0
  110. package/utils/constants.d.ts +21 -0
  111. package/utils/css.d.ts +13 -0
  112. package/utils/dependencies.d.ts +0 -38
  113. package/utils/discord.d.ts +3 -9
  114. package/utils/index.d.ts +1 -0
  115. package/utils/margins.d.ts +1 -1
  116. package/utils/misc.d.ts +0 -2
  117. package/utils/native.d.ts +0 -1
  118. package/utils/react.d.ts +1 -1
  119. package/utils/text.d.ts +1 -0
  120. package/utils/types.d.ts +34 -6
  121. package/utils/web-metadata.d.ts +3 -1
  122. package/webpack/common/components.d.ts +20 -76
  123. package/webpack/common/index.d.ts +0 -1
  124. package/webpack/common/internal.d.ts +2 -1
  125. package/webpack/common/stores.d.ts +27 -4
  126. package/webpack/common/utils.d.ts +2 -1
  127. package/webpack/webpack.d.ts +18 -10
  128. package/components/FormDivider.d.ts +0 -4
  129. package/plugins/betterSettings/PluginsSubmenu.d.ts +0 -1
  130. package/plugins/invisibleChat.desktop/components/DecryptionModal.d.ts +0 -2
  131. package/plugins/invisibleChat.desktop/components/EncryptionModal.d.ts +0 -1
  132. package/plugins/invisibleChat.desktop/index.d.ts +0 -55
  133. package/plugins/voiceMessages/utils.d.ts +0 -2
  134. package/utils/quickCss.d.ts +0 -1
  135. package/webpack/common/FormText.d.ts +0 -2
  136. package/webpack/common/classes.d.ts +0 -2
package/Vencord.d.ts CHANGED
@@ -17,14 +17,11 @@
17
17
  */
18
18
  import "~plugins";
19
19
  export * as Api from "./api";
20
+ export * as Plugins from "./api/PluginManager";
20
21
  export * as Components from "./components";
21
- export * as Plugins from "./plugins";
22
22
  export * as Util from "./utils";
23
- export * as QuickCss from "./utils/quickCss";
24
23
  export * as Updater from "./utils/updater";
25
24
  export * as Webpack from "./webpack";
26
25
  export * as WebpackPatcher from "./webpack/patchWebpack";
27
26
  export { PlainSettings, Settings };
28
- import "./utils/quickCss";
29
- import "./webpack/patchWebpack";
30
27
  import { PlainSettings, Settings } from "./api/Settings";
@@ -1,8 +1,9 @@
1
1
  import type { Settings } from "./api/Settings";
2
- import { CspRequestResult } from "./main/csp/manager";
2
+ import type { CspRequestResult } from "./main/csp/manager";
3
3
  import type { UserThemeHeader } from "./main/themes";
4
4
  import { IpcEvents } from "./shared/IpcEvents";
5
- import { IpcRes } from "./utils/types";
5
+ import type { IpcRes } from "./utils/types";
6
+ export declare function invoke<T = any>(event: IpcEvents, ...args: any[]): Promise<T>;
6
7
  export declare function sendSync<T = any>(event: IpcEvents, ...args: any[]): T;
7
8
  declare const _default: {
8
9
  themes: {
@@ -31,10 +32,13 @@ declare const _default: {
31
32
  addThemeChangeListener(cb: () => void): void;
32
33
  openFile: () => Promise<void>;
33
34
  openEditor: () => Promise<void>;
35
+ getEditorTheme: () => string;
34
36
  };
35
37
  native: {
36
38
  getVersions: () => Partial<NodeJS.ProcessVersions>;
37
39
  openExternal: (url: string) => Promise<void>;
40
+ getRendererCss: () => Promise<string>;
41
+ onRendererCssUpdate: (cb: (newCss: string) => void) => void;
38
42
  };
39
43
  csp: {
40
44
  /**
package/api/Badges.d.ts CHANGED
@@ -9,7 +9,7 @@ export interface ProfileBadge {
9
9
  /** Custom component for the badge (tooltip not included) */
10
10
  component?: ComponentType<ProfileBadge & BadgeUserArgs>;
11
11
  /** The custom image to use */
12
- image?: string;
12
+ iconSrc?: string;
13
13
  link?: string;
14
14
  /** Action to perform when you click the badge */
15
15
  onClick?(event: React.MouseEvent, props: ProfileBadge & BadgeUserArgs): void;
@@ -24,7 +24,8 @@ export interface ProfileBadge {
24
24
  /** The badge name to display, Discord uses this. Required for component badges */
25
25
  key?: string;
26
26
  /**
27
- * Allows dynamically returning multiple badges
27
+ * Allows dynamically returning multiple badges.
28
+ * Must not call hooks
28
29
  */
29
30
  getBadges?(userInfo: BadgeUserArgs): ProfileBadge[];
30
31
  }
@@ -1,4 +1,5 @@
1
1
  import "./ChatButton.css";
2
+ import { IconComponent } from "../utils/types";
2
3
  import { Channel } from "@vencord/discord-types";
3
4
  import { HTMLProps, JSX, MouseEventHandler, ReactNode } from "react";
4
5
  export interface ChatBarProps {
@@ -60,16 +61,33 @@ export interface ChatBarProps {
60
61
  }
61
62
  export type ChatBarButtonFactory = (props: ChatBarProps & {
62
63
  isMainChat: boolean;
64
+ isAnyChat: boolean;
63
65
  }) => JSX.Element | null;
66
+ export type ChatBarButtonData = {
67
+ render: ChatBarButtonFactory;
68
+ /**
69
+ * This icon is used only for Settings UI. Your render function must still render an icon,
70
+ * and it can be different from this one.
71
+ */
72
+ icon: IconComponent;
73
+ };
74
+ /**
75
+ * Don't use this directly, use {@link addChatBarButton} and {@link removeChatBarButton} instead.
76
+ */
77
+ export declare const ChatBarButtonMap: Map<string, ChatBarButtonData>;
64
78
  export declare function _injectButtons(buttons: ReactNode[], props: ChatBarProps): void;
65
- export declare const addChatBarButton: (id: string, button: ChatBarButtonFactory) => Map<string, ChatBarButtonFactory>;
79
+ /**
80
+ * The icon argument is used only for Settings UI. Your render function must still render an icon,
81
+ * and it can be different from this one.
82
+ */
83
+ export declare const addChatBarButton: (id: string, render: ChatBarButtonFactory, icon: IconComponent) => Map<string, ChatBarButtonData>;
66
84
  export declare const removeChatBarButton: (id: string) => boolean;
67
85
  export interface ChatBarButtonProps {
68
86
  children: ReactNode;
69
87
  tooltip: string;
70
- onClick: MouseEventHandler<HTMLButtonElement>;
71
- onContextMenu?: MouseEventHandler<HTMLButtonElement>;
72
- onAuxClick?: MouseEventHandler<HTMLButtonElement>;
73
- buttonProps?: Omit<HTMLProps<HTMLButtonElement>, "size" | "onClick" | "onContextMenu" | "onAuxClick">;
88
+ onClick: MouseEventHandler;
89
+ onContextMenu?: MouseEventHandler;
90
+ onAuxClick?: MouseEventHandler;
91
+ buttonProps?: Omit<HTMLProps<HTMLDivElement>, "size" | "onClick" | "onContextMenu" | "onAuxClick">;
74
92
  }
75
93
  export declare const ChatBarButton: import("react").FunctionComponent<ChatBarButtonProps>;
@@ -1,3 +1,4 @@
1
+ import { IconComponent } from "../utils/types";
1
2
  import { Channel, Message } from "@vencord/discord-types";
2
3
  import type { ComponentType, MouseEventHandler } from "react";
3
4
  export interface MessagePopoverButtonItem {
@@ -10,7 +11,19 @@ export interface MessagePopoverButtonItem {
10
11
  onContextMenu?: MouseEventHandler<HTMLButtonElement>;
11
12
  }
12
13
  export type MessagePopoverButtonFactory = (message: Message) => MessagePopoverButtonItem | null;
13
- export declare const buttons: Map<string, MessagePopoverButtonFactory>;
14
- export declare function addMessagePopoverButton(identifier: string, item: MessagePopoverButtonFactory): void;
14
+ export type MessagePopoverButtonData = {
15
+ render: MessagePopoverButtonFactory;
16
+ /**
17
+ * This icon is used only for Settings UI. Your render function must still return an icon,
18
+ * and it can be different from this one.
19
+ */
20
+ icon: IconComponent;
21
+ };
22
+ export declare const MessagePopoverButtonMap: Map<string, MessagePopoverButtonData>;
23
+ /**
24
+ * The icon argument is used only for Settings UI. Your render function must still return an icon,
25
+ * and it can be different from this one.
26
+ */
27
+ export declare function addMessagePopoverButton(identifier: string, render: MessagePopoverButtonFactory, icon: IconComponent): void;
15
28
  export declare function removeMessagePopoverButton(identifier: string): void;
16
29
  export declare function _buildPopoverElements(Component: React.ComponentType<MessagePopoverButtonItem>, message: Message): import("react").JSX.Element;
@@ -1,12 +1,12 @@
1
1
  import { Logger } from "../utils/Logger";
2
2
  import { Patch, Plugin, StartAt } from "../utils/types";
3
3
  import { FluxDispatcher } from "../webpack/common";
4
- import { patches } from "../webpack/patchWebpack";
4
+ import Plugins from "~plugins";
5
+ export { Plugins as plugins };
5
6
  export declare const PMLogger: Logger;
6
- export declare const plugins: Record<string, Plugin>;
7
- export { patches };
8
7
  export declare function isPluginEnabled(p: string): boolean;
9
8
  export declare function addPatch(newPatch: Omit<Patch, "plugin">, pluginName: string, pluginPath?: string): void;
9
+ export declare function pluginRequiresRestart(p: Plugin): boolean;
10
10
  export declare const startAllPlugins: (target: StartAt) => void;
11
11
  export declare function startDependenciesRecursive(p: Plugin): {
12
12
  restartNeeded: boolean;
@@ -17,3 +17,4 @@ export declare function unsubscribePluginFluxEvents(p: Plugin, fluxDispatcher: t
17
17
  export declare function subscribeAllPluginsFluxEvents(fluxDispatcher: typeof FluxDispatcher): void;
18
18
  export declare const startPlugin: (p: Plugin) => boolean;
19
19
  export declare const stopPlugin: (p: Plugin) => boolean;
20
+ export declare const initPluginManager: () => void;
package/api/Settings.d.ts CHANGED
@@ -1,5 +1,14 @@
1
1
  import { SettingsStore as SettingsStoreClass } from "../shared/SettingsStore";
2
2
  import { DefinedSettings, SettingsChecks, SettingsDefinition } from "../utils/types";
3
+ export interface SettingsPluginUiElement {
4
+ enabled: boolean;
5
+ /** not implemented for now */
6
+ order?: number;
7
+ }
8
+ export type SettingsPluginUiElements = {
9
+ /** id will be whatever id the element was registered with. Usually, but not always, the plugin name */
10
+ [id: string]: SettingsPluginUiElement;
11
+ };
3
12
  export interface Settings {
4
13
  autoUpdate: boolean;
5
14
  autoUpdateNotification: boolean;
@@ -20,6 +29,10 @@ export interface Settings {
20
29
  [setting: string]: any;
21
30
  };
22
31
  };
32
+ uiElements: {
33
+ messagePopoverButtons: SettingsPluginUiElements;
34
+ chatBarButtons: SettingsPluginUiElements;
35
+ };
23
36
  notifications: {
24
37
  timeout: number;
25
38
  position: "top-right" | "bottom-right";
@@ -62,6 +75,6 @@ export declare function migratePluginSetting(pluginName: string, oldSetting: str
62
75
  export declare function definePluginSettings<Def extends SettingsDefinition, Checks extends SettingsChecks<Def>, PrivateSettings extends object = {}>(def: Def, checks?: Checks): DefinedSettings<Def, Checks, PrivateSettings>;
63
76
  type UseSettings<T extends object> = ResolveUseSettings<T>[keyof T];
64
77
  type ResolveUseSettings<T extends object> = {
65
- [Key in keyof T]: Key extends string ? T[Key] extends Record<string, unknown> ? UseSettings<T[Key]> extends string ? `${Key}.${UseSettings<T[Key]>}` : never : Key : never;
78
+ [Key in keyof T]: Key extends string ? T[Key] extends Record<string, unknown> ? `${Key}.*` | (ResolveUseSettings<T[Key]> extends Record<string, string> ? `${Key}.${ResolveUseSettings<T[Key]>[keyof T[Key]]}` : never) : Key : never;
66
79
  };
67
80
  export {};
@@ -1,5 +1,5 @@
1
- import { Logger } from "./Logger";
2
- export declare const cloudLogger: Logger;
1
+ import { Logger } from "../../utils/Logger";
2
+ export declare const logger: Logger;
3
3
  export declare const getCloudUrl: () => URL;
4
4
  export declare function checkCloudUrlCsp(): Promise<boolean>;
5
5
  export declare function getAuthorization(): Promise<string>;
@@ -0,0 +1,5 @@
1
+ export declare function shouldCloudSync(direction: "push" | "pull"): boolean;
2
+ export declare function putCloudSettings(manual?: boolean): Promise<void>;
3
+ export declare function getCloudSettings(shouldNotify?: boolean, force?: boolean): Promise<boolean | undefined>;
4
+ export declare function deleteCloudSettings(): Promise<void>;
5
+ export declare function eraseAllCloudData(): Promise<void>;
@@ -4,6 +4,3 @@ export declare function exportSettings({ minify }?: {
4
4
  }): Promise<string>;
5
5
  export declare function downloadSettingsBackup(): Promise<void>;
6
6
  export declare function uploadSettingsBackup(showToast?: boolean): Promise<void>;
7
- export declare function putCloudSettings(manual?: boolean): Promise<void>;
8
- export declare function getCloudSettings(shouldNotify?: boolean, force?: boolean): Promise<boolean | undefined>;
9
- export declare function deleteCloudSettings(): Promise<void>;
package/api/Styles.d.ts CHANGED
@@ -1,17 +1,27 @@
1
- import type { MapValue } from "type-fest/source/entry";
2
- export type Style = MapValue<typeof VencordStyles>;
3
- export declare const styleMap: Map<string, {
1
+ /** @deprecated Import this from `@utils/css` instead */
2
+ export declare const classNameFactory: (prefix?: string) => (...args: import("../utils/css").ClassNameFactoryArg[]) => string;
3
+ export interface Style {
4
4
  name: string;
5
5
  source: string;
6
6
  classNames: Record<string, string>;
7
7
  dom: HTMLStyleElement | null;
8
- }>;
9
- export declare function requireStyle(name: string): {
10
- name: string;
11
- source: string;
12
- classNames: Record<string, string>;
13
- dom: HTMLStyleElement | null;
14
- };
8
+ }
9
+ export declare const styleMap: Map<string, Style>;
10
+ export declare const vencordRootNode: HTMLElement;
11
+ /**
12
+ * Houses all Vencord core styles. This includes all imported css files
13
+ */
14
+ export declare const coreStyleRootNode: HTMLElement;
15
+ /**
16
+ * Houses all plugin specific managed styles
17
+ */
18
+ export declare const managedStyleRootNode: HTMLElement;
19
+ /**
20
+ * Houses the user's themes and quick css
21
+ */
22
+ export declare const userStyleRootNode: HTMLElement;
23
+ export declare function initStyles(): void;
24
+ export declare function requireStyle(name: string): Style;
15
25
  /**
16
26
  * A style's name can be obtained from importing a stylesheet with `?managed` at the end of the import
17
27
  * @param name The name of the style
@@ -75,23 +85,3 @@ export declare const setStyleClassNames: (name: string, classNames: Record<strin
75
85
  * @see {@link setStyleClassNames} for more info on style classnames
76
86
  */
77
87
  export declare const compileStyle: (style: Style) => void;
78
- /**
79
- * @param name The classname
80
- * @param prefix A prefix to add each class, defaults to `""`
81
- * @return A css selector for the classname
82
- * @example
83
- * classNameToSelector("foo bar") // => ".foo.bar"
84
- */
85
- export declare const classNameToSelector: (name: string, prefix?: string) => string;
86
- type ClassNameFactoryArg = string | string[] | Record<string, unknown> | false | null | undefined | 0 | "";
87
- /**
88
- * @param prefix The prefix to add to each class, defaults to `""`
89
- * @returns A classname generator function
90
- * @example
91
- * const cl = classNameFactory("plugin-");
92
- *
93
- * cl("base", ["item", "editable"], { selected: null, disabled: true })
94
- * // => "plugin-base plugin-item plugin-editable plugin-disabled"
95
- */
96
- export declare const classNameFactory: (prefix?: string) => (...args: ClassNameFactoryArg[]) => string;
97
- export {};
@@ -0,0 +1,2 @@
1
+ import { ThemeStore } from "@vencord/discord-types";
2
+ export declare function initQuickCssThemeStore(themeStore: ThemeStore): void;
package/api/index.d.ts CHANGED
@@ -11,9 +11,11 @@ import * as $MessagePopover from "./MessagePopover";
11
11
  import * as $MessageUpdater from "./MessageUpdater";
12
12
  import * as $Notices from "./Notices";
13
13
  import * as $Notifications from "./Notifications";
14
+ export * as PluginManager from "./PluginManager";
14
15
  import * as $ServerList from "./ServerList";
15
16
  import * as $Settings from "./Settings";
16
17
  import * as $Styles from "./Styles";
18
+ import * as $Themes from "./Themes";
17
19
  import * as $UserSettings from "./UserSettings";
18
20
  /**
19
21
  * An API allowing you to listen to Message Clicks or run your own logic
@@ -99,3 +101,7 @@ export declare const MessageUpdater: typeof $MessageUpdater;
99
101
  * An API allowing you to get an user setting
100
102
  */
101
103
  export declare const UserSettings: typeof $UserSettings;
104
+ /**
105
+ * Don't use this
106
+ */
107
+ export declare const Themes: typeof $Themes;
@@ -0,0 +1,34 @@
1
+ import "./BaseText.css";
2
+ import type { Text as DiscordText } from "@vencord/discord-types";
3
+ import type { ComponentPropsWithoutRef, ReactNode } from "react";
4
+ declare const Sizes: {
5
+ readonly xxs: "0.625rem";
6
+ readonly xs: "0.75rem";
7
+ readonly sm: "0.875rem";
8
+ readonly md: "1rem";
9
+ readonly lg: "1.25rem";
10
+ readonly xl: "1.5rem";
11
+ readonly xxl: "2rem";
12
+ };
13
+ declare const Weights: {
14
+ readonly thin: "100";
15
+ readonly extralight: "200";
16
+ readonly light: "300";
17
+ readonly normal: "400";
18
+ readonly medium: "500";
19
+ readonly semibold: "600";
20
+ readonly bold: "700";
21
+ readonly extrabold: "800";
22
+ };
23
+ export declare function generateTextCss(): string;
24
+ export type TextSize = keyof typeof Sizes;
25
+ export type TextWeight = keyof typeof Weights;
26
+ export type TextTag = "div" | "span" | "p" | `h${1 | 2 | 3 | 4 | 5 | 6}`;
27
+ export type BaseTextProps<Tag extends TextTag = "div"> = ComponentPropsWithoutRef<Tag> & {
28
+ size?: TextSize;
29
+ weight?: TextWeight;
30
+ tag?: Tag;
31
+ };
32
+ export declare function BaseText<T extends TextTag = "div">(props: BaseTextProps<T>): ReactNode;
33
+ export declare const TextCompat: DiscordText;
34
+ export {};
@@ -0,0 +1,21 @@
1
+ import "./Button.css";
2
+ import type { Button as DiscordButton } from "@vencord/discord-types";
3
+ import type { ComponentPropsWithRef } from "react";
4
+ export type ButtonVariant = "primary" | "secondary" | "dangerPrimary" | "dangerSecondary" | "overlayPrimary" | "positive" | "link" | "none";
5
+ export type ButtonSize = "min" | "xs" | "small" | "medium" | "iconOnly";
6
+ export type ButtonProps = ComponentPropsWithRef<"button"> & {
7
+ variant?: ButtonVariant;
8
+ size?: ButtonSize;
9
+ };
10
+ export type LinkButtonProps = ComponentPropsWithRef<"a"> & {
11
+ size?: ButtonSize;
12
+ variant?: ButtonVariant;
13
+ };
14
+ export declare function Button({ variant, size, children, className, ...restProps }: ButtonProps): import("react").JSX.Element;
15
+ export declare function LinkButton({ variant, size, className, children, ...restProps }: LinkButtonProps): import("react").JSX.Element;
16
+ export type TextButtonVariant = "primary" | "secondary" | "danger" | "link";
17
+ export type TextButtonProps = ComponentPropsWithRef<"button"> & {
18
+ variant?: TextButtonVariant;
19
+ };
20
+ export declare function TextButton({ variant, className, ...restProps }: TextButtonProps): import("react").JSX.Element;
21
+ export declare const ButtonCompat: DiscordButton;
@@ -0,0 +1,8 @@
1
+ import "./Card.css";
2
+ import { ComponentPropsWithRef } from "react";
3
+ export interface CardProps extends ComponentPropsWithRef<"div"> {
4
+ variant?: "normal" | "warning" | "danger";
5
+ /** Add a default padding of 1em to the card. This is implied if no className prop is passed */
6
+ defaultPadding?: boolean;
7
+ }
8
+ export declare function Card({ variant, defaultPadding, children, className, ...restProps }: CardProps): import("react").JSX.Element;
@@ -5,3 +5,9 @@ export declare function CodeBlock(props: {
5
5
  content?: string;
6
6
  lang: string;
7
7
  }): import("react").JSX.Element;
8
+ /**
9
+ * Renders inline code like `this`
10
+ */
11
+ export declare function InlineCode({ children }: {
12
+ children: React.ReactNode;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import "./Divider.css";
2
+ import type { ComponentPropsWithoutRef } from "react";
3
+ export type DividerProps = ComponentPropsWithoutRef<"hr">;
4
+ export declare function Divider({ className, ...restProps }: DividerProps): import("react").JSX.Element;
@@ -21,6 +21,8 @@ interface Props<T = any> {
21
21
  wrappedProps?: T;
22
22
  }
23
23
  declare const ErrorBoundary: LazyComponentWrapper<React.ComponentType<React.PropsWithChildren<Props>> & {
24
- wrap<T extends object = any>(Component: React.ComponentType<T>, errorBoundaryProps?: Omit<Props<T>, "wrappedProps">): React.FunctionComponent<T>;
24
+ wrap<T extends object = any>(Component: React.ComponentType<T>, errorBoundaryProps?: Omit<Props<T>, "wrappedProps"> & {
25
+ displayName?: string;
26
+ }): React.FunctionComponent<T>;
25
27
  }>;
26
28
  export default ErrorBoundary;
@@ -1,5 +1,9 @@
1
- export declare function Flex(props: React.PropsWithChildren<{
2
- flexDirection?: React.CSSProperties["flexDirection"];
3
- style?: React.CSSProperties;
4
- className?: string;
5
- } & React.HTMLProps<HTMLDivElement>>): import("react").JSX.Element;
1
+ import type { CSSProperties, HTMLAttributes } from "react";
2
+ export interface FlexProps extends HTMLAttributes<HTMLDivElement> {
3
+ flexDirection?: CSSProperties["flexDirection"];
4
+ gap?: CSSProperties["gap"];
5
+ justifyContent?: CSSProperties["justifyContent"];
6
+ alignItems?: CSSProperties["alignItems"];
7
+ flexWrap?: CSSProperties["flexWrap"];
8
+ }
9
+ export declare function Flex({ flexDirection, gap, justifyContent, alignItems, flexWrap, children, style, ...restProps }: FlexProps): import("react").JSX.Element;
@@ -10,5 +10,4 @@ export interface FormSwitchProps {
10
10
  hideBorder?: boolean;
11
11
  }
12
12
  export declare function FormSwitch({ onChange, title, value, description, disabled, className, hideBorder }: FormSwitchProps): import("react").JSX.Element;
13
- /** Compatibility with Discord's old FormSwitch */
14
- export declare function FormSwitchCompat(props: PropsWithChildren<any>): import("react").JSX.Element;
13
+ export declare function FormSwitchCompat({ note, children, ...restProps }: PropsWithChildren<any>): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import "./Heading.css";
2
+ import type { ComponentPropsWithoutRef } from "react";
3
+ export type HeadingTag = `h${1 | 2 | 3 | 4 | 5 | 6}`;
4
+ export type HeadingProps<Tag extends HeadingTag> = ComponentPropsWithoutRef<Tag> & {
5
+ tag?: Tag;
6
+ };
7
+ /**
8
+ * A simple heading component that automatically sizes according to the tag used.
9
+ *
10
+ * If you need more control, use the BaseText component instead.
11
+ */
12
+ export declare function Heading<T extends HeadingTag>(props: HeadingProps<T>): import("react").JSX.Element;
13
+ export declare function HeadingPrimary({ children, ...restProps }: HeadingProps<"h2">): import("react").JSX.Element;
14
+ export declare function HeadingSecondary({ children, ...restProps }: HeadingProps<"h3">): import("react").JSX.Element;
15
+ export declare function HeadingTertiary({ children, ...restProps }: HeadingProps<"h4">): import("react").JSX.Element;
@@ -37,4 +37,17 @@ export declare function PaintbrushIcon(props: IconProps): JSX.Element;
37
37
  export declare function PencilIcon(props: IconProps): JSX.Element;
38
38
  export declare function GithubIcon(props: IconProps): JSX.Element;
39
39
  export declare function WebsiteIcon(props: IconProps): JSX.Element;
40
+ /**
41
+ * A question mark inside a square, used as a placeholder icon when no other icon is available
42
+ */
43
+ export declare function PlaceholderIcon(props: IconProps): JSX.Element;
44
+ export declare function MainSettingsIcon(props: IconProps): JSX.Element;
45
+ export declare function PluginsIcon(props: IconProps): JSX.Element;
46
+ export declare function CloudIcon(props: IconProps): JSX.Element;
47
+ export declare function BackupRestoreIcon(props: IconProps): JSX.Element;
48
+ export declare function UpdaterIcon(props: IconProps): JSX.Element;
49
+ export declare function PatchHelperIcon(props: IconProps): JSX.Element;
50
+ export declare function VesktopSettingsIcon(props: IconProps): JSX.Element;
51
+ export declare function CloudDownloadIcon(props: IconProps): JSX.Element;
52
+ export declare function CloudUploadIcon(props: IconProps): JSX.Element;
40
53
  export {};
@@ -0,0 +1,3 @@
1
+ import { type BaseTextProps } from "./BaseText";
2
+ export type ParagraphProps = BaseTextProps<"p">;
3
+ export declare function Paragraph({ children, ...restProps }: ParagraphProps): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { type BaseTextProps } from "./BaseText";
2
+ export type SpanProps = BaseTextProps<"span">;
3
+ export declare function Span({ children, ...restProps }: SpanProps): import("react").JSX.Element;
@@ -1,8 +1,7 @@
1
1
  import "./Switch.css";
2
- interface SwitchProps {
2
+ export interface SwitchProps {
3
+ disabled?: boolean;
3
4
  checked: boolean;
4
5
  onChange: (checked: boolean) => void;
5
- disabled?: boolean;
6
6
  }
7
7
  export declare function Switch({ checked, onChange, disabled }: SwitchProps): import("react").JSX.Element;
8
- export {};
@@ -0,0 +1,4 @@
1
+ import { TooltipProps } from "@vencord/discord-types";
2
+ export declare function TooltipContainer({ children, ...props }: Omit<TooltipProps, "children"> & {
3
+ children: React.ReactNode;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { Tooltip } from "@vencord/discord-types";
2
+ /** Don't use this */
3
+ export declare const TooltipFallback: Tooltip;
@@ -1,13 +1,20 @@
1
+ export * from "./BaseText";
2
+ export * from "./Button";
3
+ export * from "./Card";
1
4
  export * from "./CheckedTextInput";
2
5
  export * from "./CodeBlock";
6
+ export * from "./Divider";
3
7
  export { default as ErrorBoundary } from "./ErrorBoundary";
4
8
  export * from "./ErrorCard";
5
9
  export * from "./Flex";
6
- export * from "./FormDivider";
7
10
  export * from "./FormSwitch";
8
11
  export * from "./Grid";
12
+ export * from "./Heading";
9
13
  export * from "./Heart";
10
14
  export * from "./Icons";
11
15
  export * from "./Link";
16
+ export * from "./margins";
17
+ export * from "./Paragraph";
12
18
  export * from "./settings";
19
+ export * from "./Span";
13
20
  export * from "./Switch";
@@ -0,0 +1,7 @@
1
+ declare const Directions: readonly ["top", "bottom", "left", "right"];
2
+ declare const Sizes: readonly [8, 16, 20];
3
+ export type MarginDirection = (typeof Directions)[number];
4
+ export type MarginSize = (typeof Sizes)[number];
5
+ export declare const Margins: Record<`${MarginDirection}${MarginSize}`, string>;
6
+ export declare function generateMarginCss(): string;
7
+ export {};
@@ -1,7 +1,6 @@
1
1
  import { handleComponentFailed } from "../../handleComponentFailed";
2
2
  import type { ComponentType, PropsWithChildren } from "react";
3
- export declare function SettingsTab({ title, children }: PropsWithChildren<{
4
- title: string;
5
- }>): import("react").JSX.Element;
3
+ export declare function SettingsTab({ children }: PropsWithChildren): import("react").JSX.Element;
6
4
  export declare const handleSettingsTabError: typeof handleComponentFailed;
7
5
  export declare function wrapTab(component: ComponentType<any>, tab: string): import("react").FunctionComponent<any>;
6
+ export declare function openSettingsTabModal(Tab: ComponentType<any>): void;
@@ -7,5 +7,5 @@ export { openPluginModal } from "./plugins/PluginModal";
7
7
  export { default as BackupAndRestoreTab } from "./sync/BackupAndRestoreTab";
8
8
  export { default as CloudTab } from "./sync/CloudTab";
9
9
  export { default as ThemesTab } from "./themes";
10
- export { openUpdaterModal, default as UpdaterTab } from "./updater";
10
+ export { default as UpdaterTab } from "./updater";
11
11
  export { default as VencordTab } from "./vencord";
@@ -1,5 +1,4 @@
1
1
  import { Plugin } from "../../../../utils/types";
2
- export declare const ButtonClasses: any;
3
2
  interface PluginCardProps extends React.HTMLProps<HTMLDivElement> {
4
3
  plugin: Plugin;
5
4
  disabled: boolean;
@@ -0,0 +1,2 @@
1
+ import "./UIElements.css";
2
+ export declare function UIElementsButton(): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { DefinedSettings, PluginOptionBase } from "../../../../../utils/types";
2
2
  import { PropsWithChildren } from "react";
3
- export declare const cl: (...args: (string | false | 0 | string[] | Record<string, unknown> | null | undefined)[]) => string;
3
+ export declare const cl: (...args: import("../../../../../utils/css").ClassNameFactoryArg[]) => string;
4
4
  interface SettingBaseProps<T> {
5
5
  option: T;
6
6
  onChange(newValue: any): void;
@@ -19,6 +19,7 @@ interface SettingsSectionProps extends PropsWithChildren {
19
19
  description: string;
20
20
  error?: string | null;
21
21
  inlineSetting?: boolean;
22
+ tag?: "label" | "div";
22
23
  }
23
- export declare function SettingsSection({ name, description, error, inlineSetting, children }: SettingsSectionProps): import("react").JSX.Element;
24
+ export declare function SettingsSection({ tag: Tag, name, description, error, inlineSetting, children }: SettingsSectionProps): import("react").JSX.Element;
24
25
  export {};
@@ -1,6 +1,6 @@
1
1
  import "./styles.css";
2
2
  import { Logger } from "../../../../utils/Logger";
3
- export declare const cl: (...args: (string | false | 0 | string[] | Record<string, unknown> | null | undefined)[]) => string;
3
+ export declare const cl: (...args: import("../../../../utils/css").ClassNameFactoryArg[]) => string;
4
4
  export declare const logger: Logger;
5
5
  declare const _default: import("react").FunctionComponent<any>;
6
6
  export default _default;
@@ -1,3 +1,2 @@
1
1
  declare const _default: import("react").FunctionComponent<any> | null;
2
2
  export default _default;
3
- export declare const openUpdaterModal: (() => void) | null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vencord/types",
3
3
  "private": false,
4
- "version": "1.13.2",
4
+ "version": "1.14.1",
5
5
  "description": "",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {