@plexcord/types 1.18.6 → 1.19.2

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 (148) hide show
  1. package/PlexcordNative.d.ts +10 -4
  2. package/api/Badges.d.ts +2 -1
  3. package/api/HeaderBar.d.ts +94 -21
  4. package/api/PluginManager.d.ts +2 -8
  5. package/api/Settings.d.ts +4 -1
  6. package/api/SettingsSync/cloudSync.d.ts +1 -0
  7. package/api/SettingsSync/offline.d.ts +0 -9
  8. package/api/Styles.d.ts +18 -20
  9. package/api/UserArea.d.ts +38 -0
  10. package/api/index.d.ts +29 -24
  11. package/components/BaseText.d.ts +1 -2
  12. package/components/ErrorCard.d.ts +2 -2
  13. package/components/Flex.d.ts +2 -1
  14. package/components/Grid.d.ts +2 -2
  15. package/components/Heart.d.ts +5 -1
  16. package/components/Icons.d.ts +6 -1
  17. package/components/Notice.d.ts +27 -0
  18. package/components/ThemeSettings/ThemesTab.d.ts +4 -0
  19. package/components/ThemeSettings/UserCSSModal.d.ts +9 -0
  20. package/components/ThemeSettings/components/SettingBooleanComponent.d.ts +8 -0
  21. package/components/ThemeSettings/components/SettingColorComponent.d.ts +8 -0
  22. package/components/ThemeSettings/components/SettingNumberComponent.d.ts +7 -0
  23. package/components/ThemeSettings/components/SettingRangeComponent.d.ts +11 -0
  24. package/components/ThemeSettings/components/SettingSelectComponent.d.ts +13 -0
  25. package/components/ThemeSettings/components/SettingTextComponent.d.ts +7 -0
  26. package/components/ThemeSettings/components/index.d.ts +6 -0
  27. package/components/TooltipContainer.d.ts +4 -0
  28. package/components/TooltipFallback.d.ts +3 -0
  29. package/components/index.d.ts +1 -0
  30. package/components/settings/DonateButton.d.ts +3 -3
  31. package/components/settings/EditableText.d.ts +7 -0
  32. package/components/settings/OnlineThemeCard.d.ts +21 -0
  33. package/components/settings/QuickAction.d.ts +3 -1
  34. package/components/settings/tabs/index.d.ts +1 -1
  35. package/components/settings/tabs/plexcord/DonateButton.d.ts +3 -1
  36. package/components/settings/tabs/plexcord/index.d.ts +2 -0
  37. package/components/settings/tabs/plugins/PluginModal.d.ts +1 -1
  38. package/components/settings/tabs/plugins/components/Common.d.ts +1 -1
  39. package/components/settings/tabs/plugins/components/truncateText.d.ts +4 -0
  40. package/components/settings/tabs/plugins/index.d.ts +1 -1
  41. package/locales/en.d.ts +1572 -222
  42. package/package.json +1 -1
  43. package/plugins/_api/badges/index.d.ts +9 -14
  44. package/plugins/_api/badges/modals.d.ts +1 -0
  45. package/plugins/_api/nicknameIcons.d.ts +1 -1
  46. package/plugins/{questFocused/index.d.ts → _api/userArea.d.ts} +6 -1
  47. package/plugins/_core/settings.d.ts +64 -14
  48. package/plugins/_core/supportHelper.d.ts +10 -0
  49. package/plugins/allCallTimers/index.d.ts +1 -1
  50. package/plugins/autoZipper/index.d.ts +29 -0
  51. package/plugins/betterActivities/components/TwitchIcon.d.ts +2 -2
  52. package/plugins/betterActivities/utils.d.ts +1 -1
  53. package/plugins/betterAudioPlayer/index.d.ts +104 -0
  54. package/plugins/betterGifPicker/index.d.ts +36 -2
  55. package/plugins/betterInvites/index.d.ts +2 -1
  56. package/plugins/betterSessions/components/icons.d.ts +9 -9
  57. package/plugins/betterSessions/index.d.ts +2 -8
  58. package/plugins/betterSessions/utils.d.ts +1 -1
  59. package/plugins/betterUserArea/index.d.ts +105 -0
  60. package/plugins/{questCompleter → bypassPinPrompt}/index.d.ts +8 -5
  61. package/plugins/commandPalette/CommandPicker.d.ts +13 -0
  62. package/plugins/commandPalette/index.d.ts +124 -9
  63. package/plugins/commandPalette/registry.d.ts +116 -0
  64. package/plugins/commandPalette/settingsPanel.d.ts +1 -0
  65. package/plugins/commandPalette/{components/CommandPalette.d.ts → ui.d.ts} +1 -1
  66. package/plugins/customRPC/index.d.ts +3 -3
  67. package/plugins/customSounds/index.d.ts +1 -1
  68. package/plugins/decor/ui/index.d.ts +1 -1
  69. package/plugins/fakeNitro/index.d.ts +3 -3
  70. package/plugins/fixImagesQuality/index.d.ts +24 -0
  71. package/plugins/followUser/index.d.ts +7 -8
  72. package/plugins/friendsSince/index.d.ts +1 -0
  73. package/plugins/friendshipRanks/index.d.ts +1 -0
  74. package/plugins/fullVcPfp/index.d.ts +0 -10
  75. package/plugins/gameActivityToggle/index.d.ts +9 -11
  76. package/plugins/githubRepos/index.d.ts +1 -1
  77. package/plugins/holyNotes/index.d.ts +6 -8
  78. package/plugins/instantScreenshare/index.d.ts +37 -2
  79. package/plugins/instantScreenshare/utils.d.ts +26 -0
  80. package/plugins/jumpTo/index.d.ts +3 -1
  81. package/plugins/loginWithQR/ui/index.d.ts +1 -1
  82. package/plugins/memberCount/OnlineMemberCountStore.d.ts +3 -3
  83. package/plugins/memberCount/index.d.ts +1 -4
  84. package/plugins/messageLoggerEnhanced/LoggedMessageManager.d.ts +1 -1
  85. package/plugins/messageLoggerEnhanced/db.d.ts +2 -0
  86. package/plugins/messageLoggerEnhanced/index.d.ts +31 -1
  87. package/plugins/messageLoggerEnhanced/settings.d.ts +24 -0
  88. package/plugins/musicControls/spotify/SpotifyStore.d.ts +3 -3
  89. package/plugins/musicControls/spotify/lyrics/components/util.d.ts +1 -1
  90. package/plugins/musicControls/spotify/lyrics/providers/store.d.ts +3 -3
  91. package/plugins/musicControls/tidal/lyrics/components/util.d.ts +1 -1
  92. package/plugins/musicControls/tidal/lyrics/providers/store.d.ts +3 -3
  93. package/plugins/permissionsViewer/index.d.ts +5 -2
  94. package/plugins/permissionsViewer/utils.d.ts +1 -1
  95. package/plugins/petpet/index.d.ts +1 -1
  96. package/plugins/plexcordToolbox/index.d.ts +7 -9
  97. package/plugins/questify/index.d.ts +16 -2
  98. package/plugins/questify/native.d.ts +5 -0
  99. package/plugins/questify/settings.d.ts +14 -0
  100. package/plugins/questify/utils/components.d.ts +8 -0
  101. package/plugins/questify/utils/misc.d.ts +2 -1
  102. package/plugins/randomVoice/index.d.ts +9 -10
  103. package/plugins/relationshipNotifier/types.d.ts +0 -6
  104. package/plugins/reviewDB/utils.d.ts +1 -1
  105. package/plugins/roleColorEverywhere/index.d.ts +2 -2
  106. package/plugins/shikiCodeblocks.desktop/utils/misc.d.ts +1 -1
  107. package/plugins/showBadgesInChat/index.d.ts +1 -3
  108. package/plugins/showHiddenChannels/index.d.ts +1 -1
  109. package/plugins/sidebarChat/store.d.ts +3 -3
  110. package/plugins/soundBoardLogger/index.d.ts +6 -9
  111. package/plugins/soundBoardLogger/utils.d.ts +1 -1
  112. package/plugins/spotifyActivityToggle/index.d.ts +25 -11
  113. package/plugins/streamingCodecDisabler/index.d.ts +1 -1
  114. package/plugins/toastNotifications/types.d.ts +0 -6
  115. package/plugins/translate/utils.d.ts +1 -1
  116. package/plugins/usrbg/index.d.ts +8 -0
  117. package/plugins/voiceChannelLog.dev/index.d.ts +1 -1
  118. package/plugins/voiceMessages/index.d.ts +1 -1
  119. package/plugins/wallpaperFree/store.d.ts +3 -3
  120. package/shared/IpcEvents.d.ts +8 -5
  121. package/shared/plexcordUserAgent.d.ts +2 -0
  122. package/utils/constants.d.ts +26 -15
  123. package/utils/css.d.ts +13 -1
  124. package/utils/dependencies.d.ts +3 -0
  125. package/utils/intlHash.d.ts +0 -1
  126. package/utils/misc.d.ts +4 -0
  127. package/utils/modal.d.ts +1 -0
  128. package/utils/themes/bd/index.d.ts +33 -0
  129. package/utils/themes/index.d.ts +9 -0
  130. package/utils/themes/usercss/compiler.d.ts +1 -0
  131. package/utils/themes/usercss/index.d.ts +3 -0
  132. package/utils/themes/usercss/usercss-meta.d.ts +135 -0
  133. package/utils/types.d.ts +23 -17
  134. package/utils/updater.d.ts +0 -1
  135. package/utils/web-metadata.d.ts +3 -1
  136. package/webpack/common/components.d.ts +3 -39
  137. package/webpack/common/internal.d.ts +2 -1
  138. package/webpack/common/stores.d.ts +25 -6
  139. package/webpack/webpack.d.ts +1 -1
  140. package/components/css.d.ts +0 -1
  141. package/components/settings/tabs/themes/CspErrorCard.d.ts +0 -1
  142. package/components/settings/tabs/themes/LocalThemesTab.d.ts +0 -1
  143. package/components/settings/tabs/themes/OnlineThemesTab.d.ts +0 -1
  144. package/components/settings/tabs/themes/ThemeCard.d.ts +0 -9
  145. package/components/settings/tabs/themes/index.d.ts +0 -3
  146. package/plugins/commandPalette/commands.d.ts +0 -8
  147. package/plugins/commandPalette/components/MultipleChoice.d.ts +0 -11
  148. package/plugins/commandPalette/components/TextInput.d.ts +0 -11
@@ -1,15 +1,18 @@
1
1
  import type { Settings } from "./api/Settings";
2
- import { CspRequestResult } from "./main/csp/manager";
3
- import type { UserThemeHeader } from "./main/themes";
2
+ import type { CspRequestResult } from "./main/csp/manager";
4
3
  import { IpcEvents } from "./shared/IpcEvents";
5
- import { IpcRes } from "./utils/types";
4
+ import type { IpcRes } from "./utils/types";
5
+ export declare function invoke<T = any>(event: IpcEvents, ...args: any[]): Promise<T>;
6
6
  export declare function sendSync<T = any>(event: IpcEvents, ...args: any[]): T;
7
7
  declare const _default: {
8
8
  themes: {
9
9
  uploadTheme: (fileName: string, fileData: string) => Promise<void>;
10
10
  deleteTheme: (fileName: string) => Promise<void>;
11
11
  getThemesDir: () => Promise<string>;
12
- getThemesList: () => Promise<UserThemeHeader[]>;
12
+ getThemesList: () => Promise<{
13
+ fileName: string;
14
+ content: string;
15
+ }[]>;
13
16
  getThemeData: (fileName: string) => Promise<string | undefined>;
14
17
  getSystemValues: () => Promise<Record<string, string>>;
15
18
  openFolder: () => Promise<void>;
@@ -33,10 +36,13 @@ declare const _default: {
33
36
  addThemeChangeListener(cb: () => void): void;
34
37
  openFile: () => Promise<void>;
35
38
  openEditor: () => Promise<void>;
39
+ getEditorTheme: () => string;
36
40
  };
37
41
  native: {
38
42
  getVersions: () => Partial<NodeJS.ProcessVersions>;
39
43
  openExternal: (url: string) => Promise<void>;
44
+ getRendererCss: () => Promise<string>;
45
+ onRendererCssUpdate: (cb: (newCss: string) => void) => void;
40
46
  };
41
47
  i18n: {
42
48
  updateMainLocale: (locale?: string) => Promise<boolean>;
package/api/Badges.d.ts CHANGED
@@ -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
+ * May call hooks but then you must not use shouldShow
28
29
  */
29
30
  getBadges?(userInfo: BadgeUserArgs): ProfileBadge[];
30
31
  }
@@ -1,41 +1,114 @@
1
- import type { ComponentType, JSX, MouseEventHandler, ReactNode, RefObject } from "react";
2
- export type HeaderBarButtonFactory = () => JSX.Element | null;
3
- export interface HeaderBarButtonData {
4
- render: HeaderBarButtonFactory;
5
- icon: ComponentType<any>;
6
- priority?: number;
7
- }
8
- interface HeaderBarButton {
9
- render: HeaderBarButtonFactory;
10
- priority: number;
11
- }
12
- export declare const buttons: Map<string, HeaderBarButton>;
1
+ import type { ComponentType, JSX, MouseEventHandler, ReactNode } from "react";
13
2
  export interface HeaderBarButtonProps {
3
+ /** The icon component to render inside the button */
14
4
  icon: ComponentType<any>;
5
+ /** Tooltip text shown on hover. Pass null to disable tooltip */
15
6
  tooltip: ReactNode;
7
+ /** Called when the button is clicked */
16
8
  onClick?: MouseEventHandler<HTMLDivElement>;
9
+ /** Called when the button is right-clicked */
17
10
  onContextMenu?: MouseEventHandler<HTMLDivElement>;
11
+ /** Additional CSS class names */
18
12
  className?: string;
13
+ /** CSS class name for the icon element */
19
14
  iconClassName?: string;
15
+ /** Tooltip position relative to the button */
20
16
  position?: "top" | "bottom" | "left" | "right";
17
+ /** Whether the button appears in a selected/active state */
21
18
  selected?: boolean;
19
+ /** Whether the button is disabled */
22
20
  disabled?: boolean;
21
+ /** Whether to show a notification badge */
23
22
  showBadge?: boolean;
23
+ /** Position of the notification badge */
24
24
  badgePosition?: "top" | "bottom";
25
- ref?: RefObject<any>;
25
+ /** Size of the icon in pixels */
26
+ iconSize?: number;
27
+ /** Ref to the button element */
28
+ ref?: React.RefObject<any>;
29
+ }
30
+ export type HeaderBarButtonFactory = () => JSX.Element | null;
31
+ export interface HeaderBarButtonData {
32
+ /** Function that renders the button component */
33
+ render: HeaderBarButtonFactory;
34
+ /** Icon component used for settings UI display */
35
+ icon: ComponentType<any>;
36
+ /** Higher priority buttons appear further right. Default: 0 */
37
+ priority?: number;
38
+ /** Where to render the button. Default: "headerbar" */
39
+ location?: "headerbar" | "channeltoolbar";
26
40
  }
41
+ /**
42
+ * Button component for the top header bar (title bar area).
43
+ *
44
+ * @example
45
+ * <HeaderBarButton
46
+ * icon={MyIcon}
47
+ * tooltip="My Button"
48
+ * onClick={() => console.log("clicked")}
49
+ * />
50
+ */
27
51
  export declare const HeaderBarButton: ComponentType<HeaderBarButtonProps>;
28
52
  /**
29
- * Add a button to the header bar.
30
- * @param id Unique identifier for the button.
31
- * @param render Function that renders the button component.
32
- * @param priority Higher priority = more to the right. Default is 0.
53
+ * Button component for the channel toolbar (below the search bar).
54
+ * Automatically handles selected state styling.
55
+ *
56
+ * @example
57
+ * <ChannelToolbarButton
58
+ * icon={MyIcon}
59
+ * tooltip={isOpen ? null : "My Button"}
60
+ * onClick={() => setOpen(v => !v)}
61
+ * selected={isOpen}
62
+ * />
63
+ */
64
+ export declare function ChannelToolbarButton(props: HeaderBarButtonProps): JSX.Element;
65
+ /**
66
+ * Adds a button to the header bar (title bar area).
67
+ *
68
+ * @param id - Unique identifier for the button (e.g., "my-plugin-button")
69
+ * @param render - Function that returns the button JSX
70
+ * @param priority - Higher values appear further right. Default: 0
71
+ *
72
+ * @example
73
+ * addHeaderBarButton("my-button", () => (
74
+ * <HeaderBarButton
75
+ * icon={MyIcon}
76
+ * tooltip="My Button"
77
+ * onClick={handleClick}
78
+ * />
79
+ * ));
33
80
  */
34
81
  export declare function addHeaderBarButton(id: string, render: HeaderBarButtonFactory, priority?: number): void;
35
82
  /**
36
- * Remove a button from the header bar.
37
- * @param id The identifier of the button to remove.
83
+ * Removes a button from the header bar.
84
+ *
85
+ * @param id - The identifier used when adding the button
38
86
  */
39
87
  export declare function removeHeaderBarButton(id: string): void;
40
- export declare function _addButtons(): JSX.Element[];
41
- export {};
88
+ /**
89
+ * Adds a button to the channel toolbar (below the search bar, next to pins/members).
90
+ *
91
+ * @param id - Unique identifier for the button (e.g., "my-plugin-toolbar")
92
+ * @param render - Function that returns the button JSX
93
+ * @param priority - Higher values appear further right. Default: 0
94
+ *
95
+ * @example
96
+ * addChannelToolbarButton("my-toolbar", () => (
97
+ * <ChannelToolbarButton
98
+ * icon={MyIcon}
99
+ * tooltip="My Button"
100
+ * onClick={handleClick}
101
+ * />
102
+ * ));
103
+ */
104
+ export declare function addChannelToolbarButton(id: string, render: HeaderBarButtonFactory, priority?: number): void;
105
+ /**
106
+ * Removes a button from the channel toolbar.
107
+ *
108
+ * @param id - The identifier used when adding the button
109
+ */
110
+ export declare function removeChannelToolbarButton(id: string): void;
111
+ /** @internal Injected by HeaderBarAPI patch (do NOT call directly) */
112
+ export declare function _addHeaderBarButtons(): JSX.Element[];
113
+ /** @internal Injected by HeaderBarAPI patch (do NOT call directly) */
114
+ export declare function _addChannelToolbarButtons(toolbar: ReactNode[]): void;
@@ -4,16 +4,10 @@ import { Patch, Plugin, StartAt } from "../utils/types";
4
4
  import { FluxDispatcher } from "../webpack/common";
5
5
  import Plugins from "~plugins";
6
6
  export declare const PMLogger: Logger;
7
- /**
8
- * Whether a plugin is required (or dependency of another enabled plugin)
9
- */
10
- export declare function isPluginRequired(name: string): boolean | undefined;
11
- /**
12
- * A map of plugin names to the plugins that depend on them
13
- */
14
- export declare const calculatePluginDependencyMap: () => Record<string, string[]>;
15
7
  export declare function isPluginEnabled(p: string): boolean;
8
+ export declare function isPluginRequired(p: string): boolean;
16
9
  export declare function addPatch(newPatch: Omit<Patch, "plugin">, pluginName: string, pluginPath?: string): void;
10
+ export declare function pluginRequiresRestart(p: Plugin): boolean;
17
11
  export declare const startAllPlugins: (target: StartAt) => void;
18
12
  export declare function startDependenciesRecursive(p: Plugin): {
19
13
  restartNeeded: boolean;
package/api/Settings.d.ts CHANGED
@@ -16,6 +16,9 @@ export interface Settings {
16
16
  eagerPatches: boolean;
17
17
  enabledThemes: string[];
18
18
  enabledThemeLinks: string[];
19
+ enableOnlineThemes: boolean;
20
+ pinnedThemes: string[];
21
+ themeNames: Record<string, string>;
19
22
  enableReactDevtools: boolean;
20
23
  themeLinks: string[];
21
24
  frameless: boolean;
@@ -88,7 +91,7 @@ export declare const Settings: Settings;
88
91
  * @returns Settings
89
92
  */
90
93
  export declare function useSettings(paths?: UseSettings<Settings>[]): Settings;
91
- export declare function migratePluginToSetting(newName: string, oldName: string, settingName: string): void;
94
+ export declare function migratePluginToSettings(newName: string, oldName: string, ...settingNames: string[]): void;
92
95
  export declare function migratePluginSettings(name: string, ...oldNames: string[]): void;
93
96
  export declare function migratePluginSetting(pluginName: string, newSetting: string, oldSetting: string): void;
94
97
  export declare function migrateSettingFromPlugin(newPlugin: string, newSetting: string, oldPlugin: string, oldSetting: string): void;
@@ -1,3 +1,4 @@
1
+ export declare function shouldCloudSync(direction: "push" | "pull"): boolean;
1
2
  export declare function putCloudSettings(manual?: boolean): Promise<void>;
2
3
  export declare function getCloudSettings(shouldNotify?: boolean, force?: boolean): Promise<boolean | undefined>;
3
4
  export declare function deleteCloudSettings(): Promise<void>;
@@ -5,15 +5,6 @@ export declare function exportSettings({ syncDataStore, type, minify }: {
5
5
  type?: BackupType;
6
6
  minify?: boolean;
7
7
  }): Promise<string>;
8
- export declare function exportPlugins({ minify }?: {
9
- minify?: boolean;
10
- }): Promise<string>;
11
- export declare function exportCSS({ minify }?: {
12
- minify?: boolean;
13
- }): Promise<string>;
14
- export declare function exportDataStores({ minify }?: {
15
- minify?: boolean;
16
- }): Promise<string>;
17
8
  export declare function downloadSettingsBackup(type?: BackupType, { minify }?: {
18
9
  minify?: boolean;
19
10
  }): Promise<void>;
package/api/Styles.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /** @deprecated Import this from `@utils/css` instead */
2
+ export declare const classNameFactory: (prefix?: string) => (...args: import("../utils/css").ClassNameFactoryArg[]
3
+ /** @deprecated Import this from `@utils/css` instead */
4
+ ) => string;
1
5
  export interface Style {
2
6
  name: string;
3
7
  source: string;
@@ -5,6 +9,20 @@ export interface Style {
5
9
  dom: HTMLStyleElement | null;
6
10
  }
7
11
  export declare const styleMap: Map<string, Style>;
12
+ export declare const plexcordRootNode: HTMLElement;
13
+ /**
14
+ * Houses all Plexcord core styles. This includes all imported css files
15
+ */
16
+ export declare const coreStyleRootNode: HTMLElement;
17
+ /**
18
+ * Houses all plugin specific managed styles
19
+ */
20
+ export declare const managedStyleRootNode: HTMLElement;
21
+ /**
22
+ * Houses the user's themes and quick css
23
+ */
24
+ export declare const userStyleRootNode: HTMLElement;
25
+ export declare function initStyles(): void;
8
26
  export declare function requireStyle(name: string): Style;
9
27
  /**
10
28
  * A style's name can be obtained from importing a stylesheet with `?managed` at the end of the import
@@ -69,23 +87,3 @@ export declare const setStyleClassNames: (name: string, classNames: Record<strin
69
87
  * @see {@link setStyleClassNames} for more info on style classnames
70
88
  */
71
89
  export declare const compileStyle: (style: Style) => void;
72
- /**
73
- * @param name The classname
74
- * @param prefix A prefix to add each class, defaults to `""`
75
- * @return A css selector for the classname
76
- * @example
77
- * classNameToSelector("foo bar") // => ".foo.bar"
78
- */
79
- export declare const classNameToSelector: (name: string, prefix?: string) => string;
80
- type ClassNameFactoryArg = string | string[] | Record<string, unknown> | false | null | undefined | 0 | "";
81
- /**
82
- * @param prefix The prefix to add to each class, defaults to `""`
83
- * @returns A classname generator function
84
- * @example
85
- * const cl = classNameFactory("plugin-");
86
- *
87
- * cl("base", ["item", "editable"], { selected: null, disabled: true })
88
- * // => "plugin-base plugin-item plugin-editable plugin-disabled"
89
- */
90
- export declare const classNameFactory: (prefix?: string) => (...args: ClassNameFactoryArg[]) => string;
91
- export {};
@@ -0,0 +1,38 @@
1
+ import type { ComponentType, MouseEventHandler, ReactNode } from "react";
2
+ export interface UserAreaButtonProps {
3
+ icon: ReactNode;
4
+ tooltipText?: ReactNode;
5
+ onClick?: MouseEventHandler<HTMLDivElement>;
6
+ onContextMenu?: MouseEventHandler<HTMLDivElement>;
7
+ className?: string;
8
+ role?: string;
9
+ "aria-label"?: string;
10
+ "aria-checked"?: boolean;
11
+ disabled?: boolean;
12
+ plated?: boolean;
13
+ redGlow?: boolean;
14
+ orangeGlow?: boolean;
15
+ }
16
+ export interface UserAreaRenderProps {
17
+ nameplate?: any;
18
+ iconForeground?: string;
19
+ hideTooltips?: boolean;
20
+ }
21
+ export type UserAreaButtonFactory = (props: UserAreaRenderProps) => ReactNode;
22
+ export interface UserAreaButtonData {
23
+ render: UserAreaButtonFactory;
24
+ icon: ComponentType<{
25
+ className?: string;
26
+ }>;
27
+ priority?: number;
28
+ }
29
+ interface ButtonEntry {
30
+ render: UserAreaButtonFactory;
31
+ priority: number;
32
+ }
33
+ export declare const UserAreaButton: ComponentType<UserAreaButtonProps>;
34
+ export declare const buttons: Map<string, ButtonEntry>;
35
+ export declare function addUserAreaButton(id: string, render: UserAreaButtonFactory, priority?: number): void;
36
+ export declare function removeUserAreaButton(id: string): void;
37
+ export declare function _renderButtons(props: UserAreaRenderProps): import("react").JSX.Element[];
38
+ export {};
package/api/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import * as $ChatButtons from "./ChatButtons";
4
4
  import * as $Commands from "./Commands";
5
5
  import * as $ContextMenu from "./ContextMenu";
6
6
  import * as $DataStore from "./DataStore";
7
+ import * as $HeaderBar from "./HeaderBar";
7
8
  import * as $i18n from "./i18n";
8
9
  import * as $MemberListDecorators from "./MemberListDecorators";
9
10
  import * as $MessageAccessories from "./MessageAccessories";
@@ -14,8 +15,8 @@ import * as $MessageUpdater from "./MessageUpdater";
14
15
  import * as $NicknameIcons from "./NicknameIcons";
15
16
  import * as $Notices from "./Notices";
16
17
  import * as $Notifications from "./Notifications";
18
+ import * as $UserArea from "./UserArea";
17
19
  export * as PluginManager from "./PluginManager";
18
- import * as $HeaderBar from "./HeaderBar";
19
20
  import * as $ServerList from "./ServerList";
20
21
  import * as $Settings from "./Settings";
21
22
  import * as $Styles from "./Styles";
@@ -23,27 +24,27 @@ import * as $Themes from "./Themes";
23
24
  import * as $UserSettings from "./UserSettings";
24
25
  /**
25
26
  * An API allowing you to listen to Message Clicks or run your own logic
26
- * before a message is sent
27
+ * before a message is sent.
27
28
  *
28
- * If your plugin uses this, you must add MessageEventsAPI to its dependencies
29
+ * If your plugin uses this, you must add MessageEventsAPI to its dependencies.
29
30
  */
30
31
  export declare const MessageEvents: typeof $MessageEventsAPI;
31
32
  /**
32
33
  * An API allowing you to create custom notices
33
- * (snackbars on the top, like the Update prompt)
34
+ * (snackbars on the top, like the Update prompt).
34
35
  */
35
36
  export declare const Notices: typeof $Notices;
36
37
  /**
37
- * An API allowing you to register custom commands
38
+ * An API allowing you to register custom commands.
38
39
  */
39
40
  export declare const Commands: typeof $Commands;
40
41
  /**
41
42
  * A wrapper around IndexedDB. This can store arbitrarily
42
43
  * large data and supports a lot of datatypes (Blob, Map, ...).
43
- * For a full list, see the mdn link below
44
+ * For a full list, see the mdn link below.
44
45
  *
45
46
  * This should always be preferred over the Settings API if possible, as
46
- * localstorage has very strict size restrictions and blocks the event loop
47
+ * localstorage has very strict size restrictions and blocks the event loop.
47
48
  *
48
49
  * Make sure your keys are unique (tip: prefix them with ur plugin name)
49
50
  * and please clean up no longer needed entries.
@@ -53,40 +54,40 @@ export declare const Commands: typeof $Commands;
53
54
  */
54
55
  export declare const DataStore: typeof $DataStore;
55
56
  /**
56
- * An API allowing you to add custom components as message accessories
57
+ * An API allowing you to add custom components as message accessories.
57
58
  */
58
59
  export declare const MessageAccessories: typeof $MessageAccessories;
59
60
  /**
60
- * An API allowing you to add custom buttons in the message popover
61
+ * An API allowing you to add custom buttons in the message popover.
61
62
  */
62
63
  export declare const MessagePopover: typeof $MessagePopover;
63
64
  /**
64
- * An API allowing you to add badges to user profiles
65
+ * An API allowing you to add badges to user profiles.
65
66
  */
66
67
  export declare const Badges: typeof $Badges;
67
68
  /**
68
- * An API allowing you to add custom elements to the server list
69
+ * An API allowing you to add custom elements to the server list.
69
70
  */
70
71
  export declare const ServerList: typeof $ServerList;
71
72
  /**
72
- * An API allowing you to add components as message accessories
73
+ * An API allowing you to add components as message accessories.
73
74
  */
74
75
  export declare const MessageDecorations: typeof $MessageDecorations;
75
76
  /**
76
- * An API allowing you to add components to member list users, in both DM's and servers
77
+ * An API allowing you to add components to member list users, in both DM's and servers.
77
78
  */
78
79
  export declare const MemberListDecorators: typeof $MemberListDecorators;
79
80
  /**
80
- * An API allowing you to persist data
81
+ * An API allowing you to persist data.
81
82
  */
82
83
  export declare const Settings: typeof $Settings;
83
84
  /**
84
- * An API allowing you to dynamically load styles
85
+ * An API allowing you to dynamically load styles.
85
86
  * a
86
87
  */
87
88
  export declare const Styles: typeof $Styles;
88
89
  /**
89
- * An API allowing you to display notifications
90
+ * An API allowing you to display notifications.
90
91
  */
91
92
  export declare const Notifications: typeof $Notifications;
92
93
  /**
@@ -95,27 +96,31 @@ export declare const Notifications: typeof $Notifications;
95
96
  */
96
97
  export declare const i18n: typeof $i18n;
97
98
  /**
98
- * An api allowing you to patch and add/remove items to/from context menus
99
+ * An api allowing you to patch and add/remove items to/from context menus.
99
100
  */
100
101
  export declare const ContextMenu: typeof $ContextMenu;
101
102
  /**
102
- * An API allowing you to add buttons to the chat input
103
+ * An API allowing you to add buttons to the chat input.
103
104
  */
104
105
  export declare const ChatButtons: typeof $ChatButtons;
105
106
  /**
106
- * An API allowing you to add buttons to the header bar.
107
+ * An API allowing you to add buttons to the header bar or channel toolbar.
107
108
  */
108
109
  export declare const HeaderBar: typeof $HeaderBar;
109
110
  /**
110
- * An API allowing you to update and re-render messages
111
+ * An API allowing you to update and re-render messages.
111
112
  */
112
113
  export declare const MessageUpdater: typeof $MessageUpdater;
113
114
  /**
114
- * An API allowing you to get an user setting
115
+ * An API allowing you to get an user setting.
115
116
  */
116
117
  export declare const UserSettings: typeof $UserSettings;
117
118
  /**
118
- * An API allowing you to add icons to the nickname, in profiles
119
+ * Don't use this
120
+ */
121
+ export declare const Themes: typeof $Themes;
122
+ /**
123
+ * An API allowing you to add icons to the nickname, in profiles.
119
124
  */
120
125
  export declare const NicknameIcons: typeof $NicknameIcons;
121
126
  /**
@@ -123,9 +128,9 @@ export declare const NicknameIcons: typeof $NicknameIcons;
123
128
  */
124
129
  export declare const AudioPlayer: typeof $AudioPlayer;
125
130
  /**
126
- * Don't use this
131
+ * An API allowing you to add buttons to the user area panel.
127
132
  */
128
- export declare const Themes: typeof $Themes;
133
+ export declare const UserArea: typeof $UserArea;
129
134
  /**
130
135
  * LocaleLoader for managing plugin translations
131
136
  */
@@ -21,11 +21,10 @@ export declare const TextWeights: {
21
21
  readonly extrabold: "800";
22
22
  };
23
23
  export declare const TextColors: {
24
- readonly "header-primary": "var(--header-primary)";
25
24
  readonly "text-default": "var(--text-default)";
26
25
  readonly "text-muted": "var(--text-muted)";
27
26
  readonly "text-link": "var(--text-link)";
28
- readonly "text-danger": "var(--redesign-button-danger-background, var(--button-danger-background))";
27
+ readonly "text-danger": "var(--text-feedback-critical)";
29
28
  readonly "text-brand": "var(--text-brand)";
30
29
  readonly "text-strong": "var(--text-strong)";
31
30
  readonly "text-subtle": "var(--text-subtle)";
@@ -1,3 +1,3 @@
1
1
  import "./ErrorCard.css";
2
- import type { HTMLAttributes } from "react";
3
- export declare function ErrorCard(props: React.PropsWithChildren<HTMLAttributes<HTMLDivElement>>): import("react").JSX.Element;
2
+ import type { HTMLProps } from "react";
3
+ export declare function ErrorCard(props: React.PropsWithChildren<HTMLProps<HTMLDivElement>>): import("react").JSX.Element;
@@ -4,5 +4,6 @@ export interface FlexProps extends HTMLAttributes<HTMLDivElement> {
4
4
  gap?: CSSProperties["gap"];
5
5
  justifyContent?: CSSProperties["justifyContent"];
6
6
  alignItems?: CSSProperties["alignItems"];
7
+ flexWrap?: CSSProperties["flexWrap"];
7
8
  }
8
- export declare function Flex({ flexDirection, gap, justifyContent, alignItems, children, style, ...restProps }: FlexProps): import("react").JSX.Element;
9
+ export declare function Flex({ flexDirection, gap, justifyContent, alignItems, flexWrap, children, style, ...restProps }: FlexProps): import("react").JSX.Element;
@@ -1,8 +1,8 @@
1
- import { HTMLAttributes } from "react";
1
+ import { JSX } from "react";
2
2
  interface Props {
3
3
  columns: number;
4
4
  gap?: string;
5
5
  inline?: boolean;
6
6
  }
7
- export declare function Grid(props: Props & HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
7
+ export declare function Grid(props: Props & JSX.IntrinsicElements["div"]): JSX.Element;
8
8
  export {};
@@ -1,2 +1,6 @@
1
1
  import { SVGAttributes } from "react";
2
- export declare function Heart(props: SVGAttributes<SVGSVGElement>): import("react").JSX.Element;
2
+ interface HeartProps extends SVGAttributes<SVGSVGElement> {
3
+ fill?: string;
4
+ }
5
+ export declare function Heart({ fill, ...props }: HeartProps): import("react").JSX.Element;
6
+ export {};
@@ -27,14 +27,17 @@ export declare function Microphone(props: IconProps): import("react").JSX.Elemen
27
27
  export declare function CogWheel(props: IconProps): import("react").JSX.Element;
28
28
  export declare function ReplyIcon(props: IconProps): import("react").JSX.Element;
29
29
  export declare function DeleteIcon(props: IconProps): import("react").JSX.Element;
30
+ export declare function PluginIcon(props: IconProps): import("react").JSX.Element;
30
31
  export declare function PlusIcon(props: IconProps): import("react").JSX.Element;
31
32
  export declare function NoEntrySignIcon(props: IconProps): import("react").JSX.Element;
33
+ export declare function PasteIcon(props: IconProps): import("react").JSX.Element;
34
+ export declare function ResetIcon(props: IconProps): import("react").JSX.Element;
32
35
  export declare function SafetyIcon(props: IconProps): import("react").JSX.Element;
33
36
  export declare function NotesIcon(props: IconProps): import("react").JSX.Element;
37
+ export declare function IDIcon(props: IconProps): import("react").JSX.Element;
34
38
  export declare function FolderIcon(props: IconProps): import("react").JSX.Element;
35
39
  export declare function LogIcon(props: IconProps): import("react").JSX.Element;
36
40
  export declare function RestartIcon(props: IconProps): import("react").JSX.Element;
37
- export declare function IDIcon(props: IconProps): import("react").JSX.Element;
38
41
  export declare function PaintbrushIcon(props: IconProps): import("react").JSX.Element;
39
42
  export declare function PencilIcon(props: IconProps): import("react").JSX.Element;
40
43
  export declare function QuoteIcon(): import("react").JSX.Element;
@@ -55,4 +58,6 @@ export declare function PlextronSettingsIcon(props: IconProps): import("react").
55
58
  export declare function EyeIcon(props: IconProps): import("react").JSX.Element;
56
59
  export declare function ColorPaletteIcon(props: IconProps): import("react").JSX.Element;
57
60
  export declare function MagnifyingGlassIcon(props: IconProps): import("react").JSX.Element;
61
+ export declare function CloudDownloadIcon(props: IconProps): import("react").JSX.Element;
62
+ export declare function CloudUploadIcon(props: IconProps): import("react").JSX.Element;
58
63
  export {};
@@ -0,0 +1,27 @@
1
+ import type { ComponentType, CSSProperties, ReactNode } from "react";
2
+ export type NoticeType = "warn" | "info" | "danger" | "positive" | "preview";
3
+ export declare const NoticeTypes: Record<"WARNING" | "INFO" | "ERROR" | "POSITIVE" | "PREVIEW", NoticeType>;
4
+ export interface NoticeProps {
5
+ children: ReactNode;
6
+ className?: string;
7
+ style?: CSSProperties;
8
+ icon?: ComponentType<{
9
+ className?: string;
10
+ color?: string;
11
+ }>;
12
+ action?: ReactNode;
13
+ textColor?: string;
14
+ textVariant?: string;
15
+ hidden?: boolean;
16
+ }
17
+ declare function Warning({ children, className, style, icon, action, textColor, textVariant, hidden }: NoticeProps): import("react").JSX.Element;
18
+ declare function Info({ children, className, style, icon, action, textColor, textVariant, hidden }: NoticeProps): import("react").JSX.Element;
19
+ declare function Error({ children, className, style, icon, action, textColor, textVariant, hidden }: NoticeProps): import("react").JSX.Element;
20
+ declare function Positive({ children, className, style, icon, action, textColor, textVariant, hidden }: NoticeProps): import("react").JSX.Element;
21
+ export declare const Notice: {
22
+ Warning: typeof Warning;
23
+ Info: typeof Info;
24
+ Error: typeof Error;
25
+ Positive: typeof Positive;
26
+ };
27
+ export {};
@@ -0,0 +1,4 @@
1
+ import "./themesStyles.css";
2
+ export declare function CspErrorCard(): import("react").JSX.Element | null;
3
+ declare const _default: import("react").FunctionComponent<any>;
4
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { ModalProps } from "../../utils/modal";
2
+ import { UserstyleHeader } from "usercss-meta";
3
+ interface UserCSSSettingsModalProps {
4
+ modalProps: ModalProps;
5
+ theme: UserstyleHeader;
6
+ onSettingsReset: () => void;
7
+ }
8
+ export declare function UserCSSSettingsModal({ modalProps, theme, onSettingsReset }: UserCSSSettingsModalProps): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import "./styles.css";
2
+ interface Props {
3
+ label: string;
4
+ name: string;
5
+ themeSettings: Record<string, string>;
6
+ }
7
+ export declare function SettingBooleanComponent({ label, name, themeSettings }: Props): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import "./colorStyles.css";
2
+ interface Props {
3
+ label: string;
4
+ name: string;
5
+ themeSettings: Record<string, string>;
6
+ }
7
+ export declare function SettingColorComponent({ label, name, themeSettings }: Props): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ label: string;
3
+ name: string;
4
+ themeSettings: Record<string, string>;
5
+ }
6
+ export declare function SettingNumberComponent({ label, name, themeSettings }: Props): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,11 @@
1
+ interface Props {
2
+ label: string;
3
+ name: string;
4
+ default: number;
5
+ min?: number;
6
+ max?: number;
7
+ step?: number;
8
+ themeSettings: Record<string, string>;
9
+ }
10
+ export declare function SettingRangeComponent({ label, name, default: def, min, max, step, themeSettings }: Props): import("react").JSX.Element;
11
+ export {};