@plexcord/types 1.17.1 → 1.17.3

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 (60) hide show
  1. package/api/ChatButtons.d.ts +4 -4
  2. package/components/BaseText.d.ts +34 -0
  3. package/components/Button.d.ts +16 -0
  4. package/components/Divider.d.ts +4 -0
  5. package/components/FormSwitch.d.ts +1 -2
  6. package/components/Heading.d.ts +15 -0
  7. package/components/Paragraph.d.ts +3 -0
  8. package/components/Span.d.ts +3 -0
  9. package/components/Switch.d.ts +2 -3
  10. package/components/css.d.ts +1 -0
  11. package/components/index.d.ts +6 -1
  12. package/components/margins.d.ts +7 -0
  13. package/components/settings/tabs/plugins/PluginCard.d.ts +0 -1
  14. package/components/settings/tabs/plugins/components/Common.d.ts +2 -1
  15. package/package.json +1 -1
  16. package/plugins/autoDndWhilePlaying.desktop/index.d.ts +57 -0
  17. package/plugins/betterSessions/index.d.ts +1 -0
  18. package/plugins/betterSettings/index.d.ts +7 -10
  19. package/plugins/decodeBase64/index.d.ts +9 -2
  20. package/plugins/experiments/index.d.ts +4 -4
  21. package/plugins/hideChatButtons/index.d.ts +9 -4
  22. package/plugins/hideServers/index.d.ts +13 -6
  23. package/plugins/hideServers/settings.d.ts +12 -6
  24. package/plugins/holyNotes/index.d.ts +3 -2
  25. package/plugins/homeTyping/index.d.ts +1 -0
  26. package/plugins/iLoveSpam/index.d.ts +1 -0
  27. package/plugins/identity.desktop/index.d.ts +1 -0
  28. package/plugins/ignoreActivities/index.d.ts +35 -16
  29. package/plugins/ignoreCalls/index.d.ts +5 -2
  30. package/plugins/ignoreTerms/index.d.ts +1 -0
  31. package/plugins/imageFilename/index.d.ts +5 -2
  32. package/plugins/imageLink/index.d.ts +1 -0
  33. package/plugins/imagePreview/index.d.ts +41 -20
  34. package/plugins/imagePreview/settings.d.ts +40 -20
  35. package/plugins/imageZoom/components/Magnifier.d.ts +0 -2
  36. package/plugins/imageZoom/index.d.ts +65 -33
  37. package/plugins/imgToGif/index.d.ts +3 -0
  38. package/plugins/implicitRelationships/index.d.ts +4 -1
  39. package/plugins/inRole/index.d.ts +3 -0
  40. package/plugins/instantScreenshare/index.d.ts +1 -0
  41. package/plugins/invisibleChat.desktop/index.d.ts +5 -2
  42. package/plugins/musicControls/index.d.ts +0 -42
  43. package/plugins/musicControls/settings.d.ts +0 -42
  44. package/plugins/musicControls/tidal/lyrics/api.d.ts +1 -1
  45. package/plugins/musicControls/tidal/lyrics/types.d.ts +0 -22
  46. package/plugins/noBlockedMessages/index.d.ts +14 -5
  47. package/plugins/noNitroUpsell/index.d.ts +3 -7
  48. package/plugins/superReactionTweaks/index.d.ts +1 -1
  49. package/plugins/themeAttributes/index.d.ts +4 -0
  50. package/plugins/zipPreview/FilePreview.d.ts +1 -0
  51. package/plugins/zipPreview/ZipPreview.d.ts +6 -0
  52. package/plugins/zipPreview/index.d.ts +25 -0
  53. package/plugins/zipPreview/unzip.d.ts +12 -0
  54. package/utils/css.d.ts +1 -0
  55. package/utils/margins.d.ts +1 -1
  56. package/webpack/common/components.d.ts +11 -8
  57. package/webpack/common/stores.d.ts +1 -0
  58. package/components/FormDivider.d.ts +0 -4
  59. package/webpack/common/FormText.d.ts +0 -2
  60. /package/plugins/{hideAttachments → hideMedia}/index.d.ts +0 -0
@@ -67,9 +67,9 @@ export declare const removeChatBarButton: (id: string) => boolean;
67
67
  export interface ChatBarButtonProps {
68
68
  children: ReactNode;
69
69
  tooltip: string;
70
- onClick: MouseEventHandler<HTMLButtonElement>;
71
- onContextMenu?: MouseEventHandler<HTMLButtonElement>;
72
- onAuxClick?: MouseEventHandler<HTMLButtonElement>;
73
- buttonProps?: Omit<HTMLProps<HTMLButtonElement>, "size" | "onClick" | "onContextMenu" | "onAuxClick" | "ref">;
70
+ onClick: MouseEventHandler;
71
+ onContextMenu?: MouseEventHandler;
72
+ onAuxClick?: MouseEventHandler;
73
+ buttonProps?: Omit<HTMLProps<HTMLDivElement>, "size" | "onClick" | "onContextMenu" | "onAuxClick">;
74
74
  }
75
75
  export declare const ChatBarButton: import("react").FunctionComponent<ChatBarButtonProps>;
@@ -0,0 +1,34 @@
1
+ import "./BaseText.css";
2
+ import type { Text as DiscordText } from "@plexcord/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,16 @@
1
+ import "./Button.css";
2
+ import type { Button as DiscordButton } from "@plexcord/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 declare function Button({ variant, size, children, className, ...restProps }: ButtonProps): import("react").JSX.Element;
11
+ export type TextButtonVariant = "primary" | "secondary" | "danger" | "link";
12
+ export type TextButtonProps = ComponentPropsWithRef<"button"> & {
13
+ variant?: TextButtonVariant;
14
+ };
15
+ export declare function TextButton({ variant, className, ...restProps }: TextButtonProps): import("react").JSX.Element;
16
+ export declare const ButtonCompat: DiscordButton;
@@ -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;
@@ -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;
@@ -0,0 +1,3 @@
1
+ import { type BaseTextProps } from "./BaseText";
2
+ export type ParagraphProps = BaseTextProps<"p">;
3
+ export declare function Paragraph({ children, size, weight, ...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 @@
1
+ export declare function addPlexcordUiStyles(): void;
@@ -1,13 +1,18 @@
1
+ export * from "./BaseText";
1
2
  export * from "./CheckedTextInput";
2
3
  export * from "./CodeBlock";
4
+ export * from "./Divider";
3
5
  export { default as ErrorBoundary } from "./ErrorBoundary";
4
6
  export * from "./ErrorCard";
5
7
  export * from "./Flex";
6
- export * from "./FormDivider";
7
8
  export * from "./FormSwitch";
8
9
  export * from "./Grid";
10
+ export * from "./Heading";
9
11
  export * from "./Heart";
10
12
  export * from "./Icons";
11
13
  export * from "./Link";
14
+ export * from "./margins";
15
+ export * from "./Paragraph";
12
16
  export * from "./settings";
17
+ export * from "./Span";
13
18
  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,5 +1,4 @@
1
1
  import { Plugin } from "../../../../utils/types";
2
- export declare const ButtonClasses: any;
3
2
  interface PluginCardProps {
4
3
  plugin: Plugin;
5
4
  disabled?: boolean;
@@ -20,6 +20,7 @@ interface SettingsSectionProps extends PropsWithChildren {
20
20
  label?: string;
21
21
  error?: string | null;
22
22
  inlineSetting?: boolean;
23
+ tag?: "label" | "div";
23
24
  }
24
- export declare function SettingsSection({ name, description, label, error, inlineSetting, children }: SettingsSectionProps): import("react").JSX.Element;
25
+ export declare function SettingsSection({ tag: Tag, name, description, label, error, inlineSetting, children }: SettingsSectionProps): import("react").JSX.Element;
25
26
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@plexcord/types",
3
3
  "private": false,
4
- "version": "1.17.1",
4
+ "version": "1.17.3",
5
5
  "description": "",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
@@ -0,0 +1,57 @@
1
+ import { OptionType } from "../../utils/types";
2
+ declare const _default: {
3
+ name: string;
4
+ description: string;
5
+ authors: {
6
+ name: string;
7
+ id: bigint;
8
+ }[];
9
+ settings: import("../../utils/types").DefinedSettings<{
10
+ statusToSet: {
11
+ readonly label: string;
12
+ readonly description: string;
13
+ type: OptionType.SELECT;
14
+ readonly options: ({
15
+ label: string;
16
+ value: string;
17
+ default?: undefined;
18
+ } | {
19
+ label: string;
20
+ value: string;
21
+ default: boolean;
22
+ })[];
23
+ };
24
+ excludeInvisible: {
25
+ readonly label: string;
26
+ readonly description: string;
27
+ type: OptionType.BOOLEAN;
28
+ default: false;
29
+ };
30
+ }, import("../../utils/types").SettingsChecks<{
31
+ statusToSet: {
32
+ readonly label: string;
33
+ readonly description: string;
34
+ type: OptionType.SELECT;
35
+ readonly options: ({
36
+ label: string;
37
+ value: string;
38
+ default?: undefined;
39
+ } | {
40
+ label: string;
41
+ value: string;
42
+ default: boolean;
43
+ })[];
44
+ };
45
+ excludeInvisible: {
46
+ readonly label: string;
47
+ readonly description: string;
48
+ type: OptionType.BOOLEAN;
49
+ default: false;
50
+ };
51
+ }>, {}>;
52
+ readonly displayDescription: string;
53
+ flux: {
54
+ RUNNING_GAMES_CHANGE({ games }: any): void;
55
+ };
56
+ } & Record<PropertyKey, any> & import("../../utils/types").Plugin;
57
+ export default _default;
@@ -1,3 +1,4 @@
1
+ import "./styles.css";
1
2
  import { OptionType } from "../../utils/types";
2
3
  import { Session, SessionInfo } from "./types";
3
4
  declare const _default: {
@@ -63,14 +63,6 @@ declare const _default: {
63
63
  }>, {}>;
64
64
  readonly displayDescription: string;
65
65
  patches: ({
66
- find: string;
67
- replacement: {
68
- match: RegExp;
69
- replace: string;
70
- predicate: () => boolean;
71
- }[];
72
- predicate?: undefined;
73
- } | {
74
66
  find: string;
75
67
  replacement: {
76
68
  match: RegExp;
@@ -86,10 +78,15 @@ declare const _default: {
86
78
  predicate: () => boolean;
87
79
  } | {
88
80
  find: string;
89
- replacement: {
81
+ replacement: ({
90
82
  match: RegExp;
91
83
  replace: string;
92
- }[];
84
+ predicate: () => boolean;
85
+ } | {
86
+ match: RegExp;
87
+ replace: string;
88
+ predicate?: undefined;
89
+ })[];
93
90
  predicate?: undefined;
94
91
  })[];
95
92
  PluginsSubmenu: typeof PluginsSubmenu;
@@ -1,4 +1,5 @@
1
1
  import { OptionType } from "../../utils/types";
2
+ declare function DecodeIcon(): import("react").JSX.Element;
2
3
  declare const _default: {
3
4
  name: string;
4
5
  description: string;
@@ -39,7 +40,13 @@ declare const _default: {
39
40
  };
40
41
  }>, {}>;
41
42
  readonly displayDescription: string;
42
- start(): void;
43
- stop(): void;
43
+ renderMessagePopoverButton(msg: import("@plexcord/discord-types").Message): {
44
+ label: string;
45
+ icon: typeof DecodeIcon;
46
+ message: import("@plexcord/discord-types").Message;
47
+ channel: import("@plexcord/discord-types").Channel;
48
+ onClick: () => void;
49
+ onContextMenu: (e: any) => void;
50
+ };
44
51
  } & Record<PropertyKey, any> & import("../../utils/types").Plugin;
45
52
  export default _default;
@@ -34,17 +34,17 @@ declare const _default: {
34
34
  } | {
35
35
  find: string;
36
36
  replacement: {
37
- match: string;
37
+ match: RegExp;
38
38
  replace: string;
39
39
  };
40
- predicate?: undefined;
40
+ predicate: () => boolean;
41
41
  } | {
42
42
  find: string;
43
43
  replacement: {
44
44
  match: RegExp;
45
- replace: string;
45
+ replace: (_: string, rest: string) => string;
46
46
  };
47
- predicate: () => boolean;
47
+ predicate?: undefined;
48
48
  } | {
49
49
  find: string;
50
50
  replacement: {
@@ -6,13 +6,15 @@ declare const _default: {
6
6
  description: string;
7
7
  settings: import("../../utils/types").DefinedSettings<{
8
8
  Color: {
9
+ readonly label: string;
10
+ readonly description: string;
9
11
  type: OptionType.BOOLEAN;
10
- description: string;
11
12
  default: false;
12
13
  };
13
14
  Open: {
15
+ readonly label: string;
16
+ readonly description: string;
14
17
  type: OptionType.BOOLEAN;
15
- description: string;
16
18
  default: false;
17
19
  onChange: (store: {
18
20
  open: boolean;
@@ -20,13 +22,15 @@ declare const _default: {
20
22
  };
21
23
  }, import("../../utils/types").SettingsChecks<{
22
24
  Color: {
25
+ readonly label: string;
26
+ readonly description: string;
23
27
  type: OptionType.BOOLEAN;
24
- description: string;
25
28
  default: false;
26
29
  };
27
30
  Open: {
31
+ readonly label: string;
32
+ readonly description: string;
28
33
  type: OptionType.BOOLEAN;
29
- description: string;
30
34
  default: false;
31
35
  onChange: (store: {
32
36
  open: boolean;
@@ -37,6 +41,7 @@ declare const _default: {
37
41
  name: string;
38
42
  id: bigint;
39
43
  }[];
44
+ readonly displayDescription: string;
40
45
  patches: {
41
46
  find: string;
42
47
  replacement: {
@@ -22,6 +22,7 @@ declare const _default: {
22
22
  id: bigint;
23
23
  }[];
24
24
  tags: string[];
25
+ readonly displayDescription: string;
25
26
  dependencies: string[];
26
27
  contextMenus: {
27
28
  "guild-header-popout": NavContextMenuPatchCallback;
@@ -42,36 +43,42 @@ declare const _default: {
42
43
  })[];
43
44
  settings: import("../../utils/types").DefinedSettings<{
44
45
  showIndicator: {
46
+ readonly label: string;
47
+ readonly description: string;
45
48
  type: import("../../utils/types").OptionType.BOOLEAN;
46
- description: string;
47
49
  default: true;
48
50
  onChange: (val: any) => void;
49
51
  };
50
52
  guildsList: {
53
+ readonly label: string;
54
+ readonly description: string;
51
55
  type: import("../../utils/types").OptionType.COMPONENT;
52
- description: string;
53
56
  component: () => import("react").JSX.Element;
54
57
  };
55
58
  resetHidden: {
59
+ readonly label: string;
60
+ readonly description: string;
56
61
  type: import("../../utils/types").OptionType.COMPONENT;
57
- description: string;
58
62
  component: () => import("react").JSX.Element;
59
63
  };
60
64
  }, import("../../utils/types").SettingsChecks<{
61
65
  showIndicator: {
66
+ readonly label: string;
67
+ readonly description: string;
62
68
  type: import("../../utils/types").OptionType.BOOLEAN;
63
- description: string;
64
69
  default: true;
65
70
  onChange: (val: any) => void;
66
71
  };
67
72
  guildsList: {
73
+ readonly label: string;
74
+ readonly description: string;
68
75
  type: import("../../utils/types").OptionType.COMPONENT;
69
- description: string;
70
76
  component: () => import("react").JSX.Element;
71
77
  };
72
78
  resetHidden: {
79
+ readonly label: string;
80
+ readonly description: string;
73
81
  type: import("../../utils/types").OptionType.COMPONENT;
74
- description: string;
75
82
  component: () => import("react").JSX.Element;
76
83
  };
77
84
  }>, {}>;
@@ -1,36 +1,42 @@
1
1
  import { OptionType } from "../../utils/types";
2
2
  declare const _default: import("../../utils/types").DefinedSettings<{
3
3
  showIndicator: {
4
+ readonly label: string;
5
+ readonly description: string;
4
6
  type: OptionType.BOOLEAN;
5
- description: string;
6
7
  default: true;
7
8
  onChange: (val: any) => void;
8
9
  };
9
10
  guildsList: {
11
+ readonly label: string;
12
+ readonly description: string;
10
13
  type: OptionType.COMPONENT;
11
- description: string;
12
14
  component: () => import("react").JSX.Element;
13
15
  };
14
16
  resetHidden: {
17
+ readonly label: string;
18
+ readonly description: string;
15
19
  type: OptionType.COMPONENT;
16
- description: string;
17
20
  component: () => import("react").JSX.Element;
18
21
  };
19
22
  }, import("../../utils/types").SettingsChecks<{
20
23
  showIndicator: {
24
+ readonly label: string;
25
+ readonly description: string;
21
26
  type: OptionType.BOOLEAN;
22
- description: string;
23
27
  default: true;
24
28
  onChange: (val: any) => void;
25
29
  };
26
30
  guildsList: {
31
+ readonly label: string;
32
+ readonly description: string;
27
33
  type: OptionType.COMPONENT;
28
- description: string;
29
34
  component: () => import("react").JSX.Element;
30
35
  };
31
36
  resetHidden: {
37
+ readonly label: string;
38
+ readonly description: string;
32
39
  type: OptionType.COMPONENT;
33
- description: string;
34
40
  component: () => import("react").JSX.Element;
35
41
  };
36
42
  }>, {}>;
@@ -9,6 +9,7 @@ declare const _default: {
9
9
  id: bigint;
10
10
  }[];
11
11
  dependencies: string[];
12
+ readonly displayDescription: string;
12
13
  patches: {
13
14
  find: string;
14
15
  replacement: {
@@ -17,8 +18,8 @@ declare const _default: {
17
18
  };
18
19
  }[];
19
20
  renderHolyNotesButton(): import("react").JSX.Element;
20
- toolboxActions: {
21
- "Open Notes"(): Promise<void>;
21
+ readonly toolboxActions: {
22
+ [x: string]: () => Promise<void>;
22
23
  };
23
24
  contextMenus: {
24
25
  message: NavContextMenuPatchCallback;
@@ -5,6 +5,7 @@ declare const _default: {
5
5
  name: string;
6
6
  id: bigint;
7
7
  }[];
8
+ readonly displayDescription: string;
8
9
  TypingIcon(): import("react").JSX.Element;
9
10
  isTyping(): boolean;
10
11
  patches: {
@@ -5,6 +5,7 @@ declare const _default: {
5
5
  name: string;
6
6
  id: bigint;
7
7
  }[];
8
+ readonly displayDescription: string;
8
9
  patches: {
9
10
  find: string;
10
11
  replacement: {
@@ -6,6 +6,7 @@ declare const _default: {
6
6
  name: string;
7
7
  id: bigint;
8
8
  }[];
9
+ readonly displayDescription: string;
9
10
  ResetCard: typeof ResetCard;
10
11
  patches: {
11
12
  find: string;