@vencord/types 1.13.1 → 1.13.7
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.
- package/Vencord.d.ts +1 -4
- package/VencordNative.d.ts +51 -0
- package/api/Badges.d.ts +1 -1
- package/api/ChatButtons.d.ts +24 -6
- package/api/MessagePopover.d.ts +15 -2
- package/{plugins/index.d.ts → api/PluginManager.d.ts} +3 -3
- package/api/Settings.d.ts +14 -1
- package/{utils/cloud.d.ts → api/SettingsSync/cloudSetup.d.ts} +2 -2
- package/api/SettingsSync/cloudSync.d.ts +4 -0
- package/{utils/settingsSync.d.ts → api/SettingsSync/offline.d.ts} +0 -3
- package/api/Styles.d.ts +4 -10
- package/api/Themes.d.ts +2 -0
- package/api/index.d.ts +6 -0
- package/components/BaseText.d.ts +34 -0
- package/components/Button.d.ts +21 -0
- package/components/Card.d.ts +8 -0
- package/components/Divider.d.ts +4 -0
- package/components/ErrorBoundary.d.ts +3 -1
- package/components/Flex.d.ts +9 -5
- package/components/FormSwitch.d.ts +1 -2
- package/components/Heading.d.ts +15 -0
- package/components/Icons.d.ts +11 -0
- package/components/Paragraph.d.ts +3 -0
- package/components/Span.d.ts +3 -0
- package/components/Switch.d.ts +2 -3
- package/components/css.d.ts +1 -0
- package/components/index.d.ts +8 -1
- package/components/margins.d.ts +7 -0
- package/components/settings/tabs/BaseTab.d.ts +2 -3
- package/components/settings/tabs/index.d.ts +1 -1
- package/components/settings/tabs/plugins/PluginCard.d.ts +0 -1
- package/components/settings/tabs/plugins/UIElements.d.ts +2 -0
- package/components/settings/tabs/plugins/components/Common.d.ts +2 -1
- package/components/settings/tabs/updater/index.d.ts +0 -1
- package/nativeModules.d.ts +12 -0
- package/package.json +5 -1
- package/plugins/_api/badges/index.d.ts +3 -6
- package/plugins/_core/settings.d.ts +61 -24
- package/plugins/betterSessions/components/RenameModal.d.ts +1 -1
- package/plugins/betterSessions/index.d.ts +1 -0
- package/plugins/betterSettings/index.d.ts +17 -16
- package/plugins/customRPC/RpcSettings.d.ts +2 -0
- package/plugins/customRPC/index.d.ts +69 -244
- package/plugins/decor/index.d.ts +2 -3
- package/plugins/decor/lib/stores/UsersDecorationsStore.d.ts +1 -1
- package/plugins/decor/lib/utils/decoration.d.ts +1 -1
- package/plugins/decor/ui/components/DecorDecorationGridDecoration.d.ts +1 -1
- package/plugins/decor/ui/components/index.d.ts +1 -1
- package/plugins/experiments/index.d.ts +4 -4
- package/plugins/fakeProfileThemes/index.d.ts +2 -2
- package/plugins/fixSpotifyEmbeds.desktop/index.d.ts +9 -1
- package/plugins/gameActivityToggle/index.d.ts +29 -0
- package/plugins/hideAttachments/index.d.ts +11 -9
- package/plugins/lastfmRichPresence/index.d.ts +11 -11
- package/plugins/noServerEmojis/index.d.ts +2 -1
- package/plugins/previewMessage/index.d.ts +5 -2
- package/plugins/quickMention/index.d.ts +15 -8
- package/plugins/replaceGoogleSearch/index.d.ts +28 -0
- package/plugins/sendTimestamps/index.d.ts +5 -2
- package/plugins/shikiCodeblocks.desktop/api/languages.d.ts +6 -8
- package/plugins/shikiCodeblocks.desktop/api/shiki.d.ts +7 -1
- package/plugins/shikiCodeblocks.desktop/api/themes.d.ts +7 -1
- package/plugins/shikiCodeblocks.desktop/index.d.ts +9 -3
- package/plugins/shikiCodeblocks.desktop/settings.d.ts +3 -3
- package/plugins/showTimeoutDuration/index.d.ts +3 -3
- package/plugins/silentMessageToggle/index.d.ts +5 -2
- package/plugins/silentTyping/index.d.ts +5 -2
- package/plugins/spotifyControls/SpotifyStore.d.ts +2 -1
- package/plugins/themeAttributes/index.d.ts +4 -0
- package/plugins/translate/TranslateIcon.d.ts +2 -5
- package/plugins/translate/index.d.ts +14 -19
- package/plugins/translate/settings.d.ts +0 -10
- package/plugins/vencordToolbox/index.d.ts +32 -2
- package/plugins/vencordToolbox/menu.d.ts +4 -0
- package/plugins/viewRaw/index.d.ts +11 -8
- package/plugins/voiceMessages/native.d.ts +1 -1
- package/shared/SettingsStore.d.ts +17 -3
- package/utils/apng.d.ts +46 -0
- package/utils/constants.d.ts +9 -0
- package/utils/css.d.ts +1 -0
- package/utils/dependencies.d.ts +0 -38
- package/utils/discord.d.ts +3 -2
- package/utils/index.d.ts +1 -0
- package/utils/intlHash.d.ts +1 -0
- package/utils/margins.d.ts +1 -1
- package/utils/misc.d.ts +0 -2
- package/utils/native.d.ts +0 -1
- package/utils/patches.d.ts +1 -1
- package/utils/react.d.ts +1 -1
- package/utils/types.d.ts +30 -6
- package/webpack/common/components.d.ts +17 -10
- package/webpack/common/stores.d.ts +1 -1
- package/webpack/common/utils.d.ts +2 -1
- package/webpack/webpack.d.ts +4 -4
- package/components/FormDivider.d.ts +0 -4
- package/plugins/betterSettings/PluginsSubmenu.d.ts +0 -1
- package/plugins/invisibleChat.desktop/components/DecryptionModal.d.ts +0 -2
- package/plugins/invisibleChat.desktop/components/EncryptionModal.d.ts +0 -1
- package/plugins/invisibleChat.desktop/index.d.ts +0 -55
- package/utils/quickCss.d.ts +0 -1
- package/webpack/common/FormText.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";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Settings } from "./api/Settings";
|
|
2
|
+
import { CspRequestResult } from "./main/csp/manager";
|
|
3
|
+
import type { UserThemeHeader } from "./main/themes";
|
|
4
|
+
import { IpcEvents } from "./shared/IpcEvents";
|
|
5
|
+
import { IpcRes } from "./utils/types";
|
|
6
|
+
export declare function sendSync<T = any>(event: IpcEvents, ...args: any[]): T;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
themes: {
|
|
9
|
+
uploadTheme: (fileName: string, fileData: string) => Promise<void>;
|
|
10
|
+
deleteTheme: (fileName: string) => Promise<void>;
|
|
11
|
+
getThemesList: () => Promise<UserThemeHeader[]>;
|
|
12
|
+
getThemeData: (fileName: string) => Promise<string | undefined>;
|
|
13
|
+
getSystemValues: () => Promise<Record<string, string>>;
|
|
14
|
+
openFolder: () => Promise<void>;
|
|
15
|
+
};
|
|
16
|
+
updater: {
|
|
17
|
+
getUpdates: () => Promise<IpcRes<Record<"message" | "author" | "hash", string>[]>>;
|
|
18
|
+
update: () => Promise<IpcRes<boolean>>;
|
|
19
|
+
rebuild: () => Promise<IpcRes<boolean>>;
|
|
20
|
+
getRepo: () => Promise<IpcRes<string>>;
|
|
21
|
+
};
|
|
22
|
+
settings: {
|
|
23
|
+
get: () => Settings;
|
|
24
|
+
set: (settings: Settings, pathToNotify?: string) => Promise<void>;
|
|
25
|
+
openFolder: () => Promise<void>;
|
|
26
|
+
};
|
|
27
|
+
quickCss: {
|
|
28
|
+
get: () => Promise<string>;
|
|
29
|
+
set: (css: string) => Promise<void>;
|
|
30
|
+
addChangeListener(cb: (newCss: string) => void): void;
|
|
31
|
+
addThemeChangeListener(cb: () => void): void;
|
|
32
|
+
openFile: () => Promise<void>;
|
|
33
|
+
openEditor: () => Promise<void>;
|
|
34
|
+
};
|
|
35
|
+
native: {
|
|
36
|
+
getVersions: () => Partial<NodeJS.ProcessVersions>;
|
|
37
|
+
openExternal: (url: string) => Promise<void>;
|
|
38
|
+
};
|
|
39
|
+
csp: {
|
|
40
|
+
/**
|
|
41
|
+
* Note: Only supports full explicit matches, not wildcards.
|
|
42
|
+
*
|
|
43
|
+
* If `*.example.com` is allowed, `isDomainAllowed("https://sub.example.com")` will return false.
|
|
44
|
+
*/
|
|
45
|
+
isDomainAllowed: (url: string, directives: string[]) => Promise<boolean>;
|
|
46
|
+
removeOverride: (url: string) => Promise<boolean>;
|
|
47
|
+
requestAddOverride: (url: string, directives: string[], callerName: string) => Promise<CspRequestResult>;
|
|
48
|
+
};
|
|
49
|
+
pluginHelpers: Record<string, Record<string, (...args: any[]) => Promise<any>>>;
|
|
50
|
+
};
|
|
51
|
+
export default _default;
|
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
|
-
|
|
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;
|
package/api/ChatButtons.d.ts
CHANGED
|
@@ -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;
|
|
64
|
-
export
|
|
65
|
-
|
|
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>;
|
|
78
|
+
export declare function _injectButtons(buttons: ReactNode[], props: ChatBarProps): ReactNode[] | undefined;
|
|
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
|
|
71
|
-
onContextMenu?: MouseEventHandler
|
|
72
|
-
onAuxClick?: MouseEventHandler
|
|
73
|
-
buttonProps?: Omit<HTMLProps<
|
|
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>;
|
package/api/MessagePopover.d.ts
CHANGED
|
@@ -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
|
|
14
|
-
|
|
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,10 +1,9 @@
|
|
|
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
|
|
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;
|
|
10
9
|
export declare const startAllPlugins: (target: StartAt) => void;
|
|
@@ -17,3 +16,4 @@ export declare function unsubscribePluginFluxEvents(p: Plugin, fluxDispatcher: t
|
|
|
17
16
|
export declare function subscribeAllPluginsFluxEvents(fluxDispatcher: typeof FluxDispatcher): void;
|
|
18
17
|
export declare const startPlugin: (p: Plugin) => boolean;
|
|
19
18
|
export declare const stopPlugin: (p: Plugin) => boolean;
|
|
19
|
+
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> ?
|
|
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 "
|
|
2
|
-
export declare const
|
|
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,4 @@
|
|
|
1
|
+
export declare function putCloudSettings(manual?: boolean): Promise<void>;
|
|
2
|
+
export declare function getCloudSettings(shouldNotify?: boolean, force?: boolean): Promise<boolean | undefined>;
|
|
3
|
+
export declare function deleteCloudSettings(): Promise<void>;
|
|
4
|
+
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,11 @@
|
|
|
1
|
-
|
|
2
|
-
export type Style = MapValue<typeof VencordStyles>;
|
|
3
|
-
export declare const styleMap: Map<string, {
|
|
1
|
+
export interface Style {
|
|
4
2
|
name: string;
|
|
5
3
|
source: string;
|
|
6
4
|
classNames: Record<string, string>;
|
|
7
5
|
dom: HTMLStyleElement | null;
|
|
8
|
-
}
|
|
9
|
-
export declare
|
|
10
|
-
|
|
11
|
-
source: string;
|
|
12
|
-
classNames: Record<string, string>;
|
|
13
|
-
dom: HTMLStyleElement | null;
|
|
14
|
-
};
|
|
6
|
+
}
|
|
7
|
+
export declare const styleMap: Map<string, Style>;
|
|
8
|
+
export declare function requireStyle(name: string): Style;
|
|
15
9
|
/**
|
|
16
10
|
* A style's name can be obtained from importing a stylesheet with `?managed` at the end of the import
|
|
17
11
|
* @param name The name of the style
|
package/api/Themes.d.ts
ADDED
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";
|
|
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;
|
|
@@ -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">
|
|
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;
|
package/components/Flex.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
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;
|
package/components/Icons.d.ts
CHANGED
|
@@ -37,4 +37,15 @@ 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;
|
|
40
51
|
export {};
|
package/components/Switch.d.ts
CHANGED
|
@@ -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 @@
|
|
|
1
|
+
export declare function addVencordUiStyles(): void;
|
package/components/index.d.ts
CHANGED
|
@@ -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({
|
|
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 {
|
|
10
|
+
export { default as UpdaterTab } from "./updater";
|
|
11
11
|
export { default as VencordTab } from "./vencord";
|
|
@@ -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 {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Vencord, a Discord client mod
|
|
3
|
+
* Copyright (c) 2025 Vendicated and contributors
|
|
4
|
+
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/// <reference types="standalone-electron-types"/>
|
|
8
|
+
|
|
9
|
+
declare module "~pluginNatives" {
|
|
10
|
+
const pluginNatives: Record<string, Record<string, (event: Electron.IpcMainInvokeEvent, ...args: unknown[]) => unknown>>;
|
|
11
|
+
export default pluginNatives;
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vencord/types",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.13.
|
|
4
|
+
"version": "1.13.7",
|
|
5
5
|
"description": "",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@types/lodash": "4.17.15",
|
|
21
21
|
"@types/node": "^22.13.4",
|
|
22
|
+
"@vencord/discord-types": "^1.0.0",
|
|
23
|
+
"highlight.js": "11.11.1",
|
|
24
|
+
"moment": "^2.22.2",
|
|
25
|
+
"ts-pattern": "^5.6.0",
|
|
22
26
|
"type-fest": "^4.35.0"
|
|
23
27
|
},
|
|
24
28
|
"peerDependencies": {
|
|
@@ -17,13 +17,10 @@ declare const _default: {
|
|
|
17
17
|
};
|
|
18
18
|
} | {
|
|
19
19
|
find: string;
|
|
20
|
-
replacement:
|
|
21
|
-
match: RegExp;
|
|
22
|
-
replace: (_: string, rest: string, originalSrc: string, badge: string) => string;
|
|
23
|
-
} | {
|
|
20
|
+
replacement: {
|
|
24
21
|
match: RegExp;
|
|
25
22
|
replace: string;
|
|
26
|
-
}
|
|
23
|
+
}[];
|
|
27
24
|
})[];
|
|
28
25
|
readonly DonorBadges: Record<string, Record<"tooltip" | "badge", string>[]>;
|
|
29
26
|
toolboxActions: {
|
|
@@ -40,7 +37,7 @@ declare const _default: {
|
|
|
40
37
|
renderBadgeComponent: import("react").FunctionComponent<ProfileBadge & BadgeUserArgs>;
|
|
41
38
|
getBadgeMouseEventHandlers(badge: ProfileBadge & BadgeUserArgs): Record<string, (e: React.MouseEvent) => void>;
|
|
42
39
|
getDonorBadges(userId: string): {
|
|
43
|
-
|
|
40
|
+
iconSrc: string;
|
|
44
41
|
description: string;
|
|
45
42
|
position: BadgePosition.START;
|
|
46
43
|
props: {
|