@plexcord/types 1.17.9 → 1.18.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 (56) hide show
  1. package/Plexcord.d.ts +2 -4
  2. package/api/Badges.d.ts +1 -1
  3. package/api/PluginManager.d.ts +27 -0
  4. package/api/SettingsSync/cloudSetup.d.ts +8 -0
  5. package/api/SettingsSync/cloudSync.d.ts +4 -0
  6. package/api/SettingsSync/offline.d.ts +19 -0
  7. package/api/Styles.d.ts +4 -10
  8. package/api/Themes.d.ts +2 -0
  9. package/api/i18n.d.ts +1 -1
  10. package/api/index.d.ts +6 -0
  11. package/components/Button.d.ts +5 -0
  12. package/components/Card.d.ts +8 -0
  13. package/components/Flex.d.ts +8 -5
  14. package/components/Icons.d.ts +1 -0
  15. package/components/index.d.ts +2 -0
  16. package/components/settings/DonateButton.d.ts +4 -2
  17. package/package.json +1 -1
  18. package/plugins/_api/badges/index.d.ts +3 -6
  19. package/plugins/channelTabs/index.d.ts +14 -0
  20. package/plugins/channelTabs/util/constants.d.ts +14 -0
  21. package/plugins/customTimestamps/index.d.ts +1 -1
  22. package/plugins/githubRepos/components/GitHubReposComponent.d.ts +0 -1
  23. package/plugins/githubRepos/index.d.ts +1 -0
  24. package/plugins/holyNotes/utils.d.ts +2 -1
  25. package/plugins/iRememberYou/index.d.ts +1 -1
  26. package/plugins/newPluginsManager/NewPluginsModal.d.ts +10 -0
  27. package/plugins/newPluginsManager/index.d.ts +20 -0
  28. package/plugins/newPluginsManager/knownSettings.d.ts +10 -0
  29. package/plugins/platformSpoofer/index.d.ts +1 -0
  30. package/plugins/plexcordToolbox/index.d.ts +1 -1
  31. package/plugins/quoter/index.d.ts +65 -11
  32. package/plugins/quoter/types.d.ts +52 -0
  33. package/plugins/quoter/utils.d.ts +9 -2
  34. package/plugins/randomVoice/index.d.ts +6 -6
  35. package/plugins/repeatMessages/index.d.ts +26 -0
  36. package/plugins/signature/index.d.ts +4 -20
  37. package/plugins/voiceButtons/index.d.ts +138 -44
  38. package/plugins/voiceButtons/settings.d.ts +138 -44
  39. package/plugins/voiceMessages/{DesktopRecorder.d.ts → components/DesktopRecorder.d.ts} +1 -1
  40. package/plugins/voiceMessages/{WebRecorder.d.ts → components/WebRecorder.d.ts} +1 -1
  41. package/plugins/voiceMessages/index.d.ts +30 -6
  42. package/utils/apng.d.ts +46 -0
  43. package/utils/constants.d.ts +9 -0
  44. package/utils/dependencies.d.ts +0 -37
  45. package/utils/discord.d.ts +3 -2
  46. package/utils/index.d.ts +1 -0
  47. package/utils/misc.d.ts +0 -2
  48. package/utils/react.d.ts +1 -1
  49. package/utils/types.d.ts +12 -12
  50. package/webpack/common/components.d.ts +6 -2
  51. package/webpack/common/stores.d.ts +1 -1
  52. package/webpack/common/utils.d.ts +1 -0
  53. package/webpack/webpack.d.ts +1 -1
  54. package/plugins/voiceMessages/settings.d.ts +0 -24
  55. package/plugins/voiceMessages/utils.d.ts +0 -1
  56. /package/plugins/voiceMessages/{VoicePreview.d.ts → components/VoicePreview.d.ts} +0 -0
package/Plexcord.d.ts CHANGED
@@ -18,14 +18,12 @@
18
18
  */
19
19
  import "~plugins";
20
20
  export * as Api from "./api";
21
+ export * as Plugins from "./api/PluginManager";
22
+ export * as QuickCss from "./api/Themes";
21
23
  export * as Components from "./components";
22
- export * as Plugins from "./plugins";
23
24
  export * as Util from "./utils";
24
- export * as QuickCss from "./utils/quickCss";
25
25
  export * as Updater from "./utils/updater";
26
26
  export * as Webpack from "./webpack";
27
27
  export * as WebpackPatcher from "./webpack/patchWebpack";
28
28
  export { PlainSettings, Settings };
29
- import "./utils/quickCss";
30
- import "./webpack/patchWebpack";
31
29
  import { PlainSettings, Settings } from "./api/Settings";
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;
@@ -0,0 +1,27 @@
1
+ import { Logger } from "../utils/Logger";
2
+ export { Plugins as plugins };
3
+ import { Patch, Plugin, StartAt } from "../utils/types";
4
+ import { FluxDispatcher } from "../webpack/common";
5
+ import Plugins from "~plugins";
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
+ export declare function isPluginEnabled(p: string): boolean;
16
+ export declare function addPatch(newPatch: Omit<Patch, "plugin">, pluginName: string, pluginPath?: string): void;
17
+ export declare const startAllPlugins: (target: StartAt) => void;
18
+ export declare function startDependenciesRecursive(p: Plugin): {
19
+ restartNeeded: boolean;
20
+ failures: string[];
21
+ };
22
+ export declare function subscribePluginFluxEvents(p: Plugin, fluxDispatcher: typeof FluxDispatcher): void;
23
+ export declare function unsubscribePluginFluxEvents(p: Plugin, fluxDispatcher: typeof FluxDispatcher): void;
24
+ export declare function subscribeAllPluginsFluxEvents(fluxDispatcher: typeof FluxDispatcher): void;
25
+ export declare const startPlugin: (p: Plugin) => boolean;
26
+ export declare const stopPlugin: (p: Plugin) => boolean;
27
+ export declare const initPluginManager: () => void;
@@ -0,0 +1,8 @@
1
+ import { Logger } from "../../utils/Logger";
2
+ export declare const logger: Logger;
3
+ export declare const getCloudUrl: () => URL;
4
+ export declare function checkCloudUrlCsp(): Promise<boolean>;
5
+ export declare function getAuthorization(): Promise<string>;
6
+ export declare function deauthorizeCloud(): Promise<void>;
7
+ export declare function authorizeCloud(): Promise<void>;
8
+ export declare function getCloudAuth(): 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>;
@@ -0,0 +1,19 @@
1
+ export declare function importSettings(data: string): Promise<void>;
2
+ export declare function exportSettings({ minify }?: {
3
+ minify?: boolean;
4
+ }): Promise<string>;
5
+ export declare function exportPlugins({ minify }?: {
6
+ minify?: boolean;
7
+ }): Promise<string>;
8
+ export declare function exportCSS({ minify }?: {
9
+ minify?: boolean;
10
+ }): Promise<string>;
11
+ export declare function exportDataStores({ minify }?: {
12
+ minify?: boolean;
13
+ }): Promise<string>;
14
+ type BackupType = "settings" | "plugins" | "css" | "datastore";
15
+ export declare function downloadSettingsBackup(type: BackupType, { minify }?: {
16
+ minify?: boolean;
17
+ }): Promise<void>;
18
+ export declare function uploadSettingsBackup(showToast?: boolean): Promise<void>;
19
+ export {};
package/api/Styles.d.ts CHANGED
@@ -1,17 +1,11 @@
1
- type MapValue<T extends Map<any, any>> = T extends Map<any, infer V> ? V : never;
2
- export type Style = MapValue<typeof PlexcordStyles>;
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 function requireStyle(name: string): {
10
- name: string;
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
@@ -0,0 +1,2 @@
1
+ import { ThemeStore } from "@plexcord/discord-types";
2
+ export declare function initQuickCssThemeStore(themeStore: ThemeStore): void;
package/api/i18n.d.ts CHANGED
@@ -62,6 +62,6 @@ export declare const getCurrentLocale: () => string;
62
62
  export declare function useGlobalLocale(): string;
63
63
  export declare function useForceUpdateOnLocaleChange(): void;
64
64
  export declare function withI18n<P extends object>(Component: React.ComponentType<P>): {
65
- (props: P): import("react").ReactElement<P, string | import("react").JSXElementConstructor<any>>;
65
+ (props: P): any;
66
66
  displayName: string;
67
67
  };
package/api/index.d.ts CHANGED
@@ -14,9 +14,11 @@ import * as $MessageUpdater from "./MessageUpdater";
14
14
  import * as $NicknameIcons from "./NicknameIcons";
15
15
  import * as $Notices from "./Notices";
16
16
  import * as $Notifications from "./Notifications";
17
+ export * as PluginManager from "./PluginManager";
17
18
  import * as $ServerList from "./ServerList";
18
19
  import * as $Settings from "./Settings";
19
20
  import * as $Styles from "./Styles";
21
+ import * as $Themes from "./Themes";
20
22
  import * as $UserSettings from "./UserSettings";
21
23
  /**
22
24
  * An API allowing you to listen to Message Clicks or run your own logic
@@ -115,6 +117,10 @@ export declare const NicknameIcons: typeof $NicknameIcons;
115
117
  * An API allowing you to play internal Discord audio files or external audio URLs/URIs.
116
118
  */
117
119
  export declare const AudioPlayer: typeof $AudioPlayer;
120
+ /**
121
+ * Don't use this
122
+ */
123
+ export declare const Themes: typeof $Themes;
118
124
  /**
119
125
  * LocaleLoader for managing plugin translations
120
126
  */
@@ -7,7 +7,12 @@ export type ButtonProps = ComponentPropsWithRef<"button"> & {
7
7
  variant?: ButtonVariant;
8
8
  size?: ButtonSize;
9
9
  };
10
+ export type LinkButtonProps = ComponentPropsWithRef<"a"> & {
11
+ size?: ButtonSize;
12
+ variant?: ButtonVariant;
13
+ };
10
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;
11
16
  export type TextButtonVariant = "primary" | "secondary" | "danger" | "link";
12
17
  export type TextButtonProps = ComponentPropsWithRef<"button"> & {
13
18
  variant?: TextButtonVariant;
@@ -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;
@@ -1,5 +1,8 @@
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
+ }
8
+ export declare function Flex({ flexDirection, gap, justifyContent, alignItems, children, style, ...restProps }: FlexProps): import("react").JSX.Element;
@@ -37,6 +37,7 @@ export declare function RestartIcon(props: IconProps): import("react").JSX.Eleme
37
37
  export declare function IDIcon(props: IconProps): import("react").JSX.Element;
38
38
  export declare function PaintbrushIcon(props: IconProps): import("react").JSX.Element;
39
39
  export declare function PencilIcon(props: IconProps): import("react").JSX.Element;
40
+ export declare function QuoteIcon(): import("react").JSX.Element;
40
41
  export declare function GithubIcon(props: IconProps): import("react").JSX.Element;
41
42
  export declare function WebsiteIcon(props: IconProps): import("react").JSX.Element;
42
43
  export {};
@@ -1,4 +1,6 @@
1
1
  export * from "./BaseText";
2
+ export * from "./Button";
3
+ export * from "./Card";
2
4
  export * from "./CheckedTextInput";
3
5
  export * from "./CodeBlock";
4
6
  export * from "./Divider";
@@ -1,2 +1,4 @@
1
- import { ButtonProps } from "@plexcord/discord-types";
2
- export default function DonateButton({ look, color, ...props }: Partial<ButtonProps>): import("react").JSX.Element;
1
+ export default function DonateButton({ variant, ...props }: {
2
+ [x: string]: any;
3
+ variant?: string | undefined;
4
+ }): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@plexcord/types",
3
3
  "private": false,
4
- "version": "1.17.9",
4
+ "version": "1.18.1",
5
5
  "description": "",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
@@ -18,13 +18,10 @@ declare const _default: {
18
18
  };
19
19
  } | {
20
20
  find: string;
21
- replacement: ({
22
- match: RegExp;
23
- replace: (_: string, rest: string, originalSrc: string, badge: string) => string;
24
- } | {
21
+ replacement: {
25
22
  match: RegExp;
26
23
  replace: string;
27
- })[];
24
+ }[];
28
25
  })[];
29
26
  readonly DonorBadges: Record<string, Record<"tooltip" | "badge", string>[]>;
30
27
  readonly toolboxActions: {
@@ -42,7 +39,7 @@ declare const _default: {
42
39
  renderBadgeComponent: import("react").FunctionComponent<ProfileBadge & BadgeUserArgs>;
43
40
  getBadgeMouseEventHandlers(badge: ProfileBadge & BadgeUserArgs): Record<string, (e: React.MouseEvent) => void>;
44
41
  getDonorBadges(userId: string): {
45
- image: string;
42
+ iconSrc: string;
46
43
  description: string;
47
44
  position: BadgePosition.START;
48
45
  props: {
@@ -379,6 +379,13 @@ declare const _default: {
379
379
  default: false;
380
380
  restartNeeded: false;
381
381
  };
382
+ newTabButtonBehavior: {
383
+ readonly label: string;
384
+ readonly description: string;
385
+ type: import("../../utils/types").OptionType.BOOLEAN;
386
+ default: true;
387
+ restartNeeded: false;
388
+ };
382
389
  oneTabPerServer: {
383
390
  readonly label: string;
384
391
  readonly description: string;
@@ -748,6 +755,13 @@ declare const _default: {
748
755
  default: false;
749
756
  restartNeeded: false;
750
757
  };
758
+ newTabButtonBehavior: {
759
+ readonly label: string;
760
+ readonly description: string;
761
+ type: import("../../utils/types").OptionType.BOOLEAN;
762
+ default: true;
763
+ restartNeeded: false;
764
+ };
751
765
  oneTabPerServer: {
752
766
  readonly label: string;
753
767
  readonly description: string;
@@ -368,6 +368,13 @@ export declare const settings: import("../../../utils/types").DefinedSettings<{
368
368
  default: false;
369
369
  restartNeeded: false;
370
370
  };
371
+ newTabButtonBehavior: {
372
+ readonly label: string;
373
+ readonly description: string;
374
+ type: OptionType.BOOLEAN;
375
+ default: true;
376
+ restartNeeded: false;
377
+ };
371
378
  oneTabPerServer: {
372
379
  readonly label: string;
373
380
  readonly description: string;
@@ -737,6 +744,13 @@ export declare const settings: import("../../../utils/types").DefinedSettings<{
737
744
  default: false;
738
745
  restartNeeded: false;
739
746
  };
747
+ newTabButtonBehavior: {
748
+ readonly label: string;
749
+ readonly description: string;
750
+ type: OptionType.BOOLEAN;
751
+ default: true;
752
+ restartNeeded: false;
753
+ };
740
754
  oneTabPerServer: {
741
755
  readonly label: string;
742
756
  readonly description: string;
@@ -40,7 +40,7 @@ declare const _default: {
40
40
  replace: string;
41
41
  }[];
42
42
  } | {
43
- find: string;
43
+ find: RegExp;
44
44
  replacement: {
45
45
  match: RegExp;
46
46
  replace: string;
@@ -1,4 +1,3 @@
1
- export declare const cl: (...args: (string | false | 0 | string[] | Record<string, unknown> | null | undefined)[]) => string;
2
1
  export declare function GitHubReposComponent({ id, theme }: {
3
2
  id: string;
4
3
  theme: string;
@@ -1,6 +1,7 @@
1
1
  import "./styles.css";
2
2
  import { User } from "@plexcord/discord-types";
3
3
  import { OptionType } from "../../utils/types";
4
+ export declare const cl: (...args: (string | false | 0 | string[] | Record<string, unknown> | null | undefined)[]) => string;
4
5
  export declare const settings: import("../../utils/types").DefinedSettings<{
5
6
  showStars: {
6
7
  readonly label: string;
@@ -1,5 +1,6 @@
1
+ import * as DataStore from "../../api/DataStore";
1
2
  import { HolyNotes } from "./types";
2
- export declare const HolyNoteStore: import("../../api/DataStore").UseStore;
3
+ export declare const HolyNoteStore: DataStore.UseStore;
3
4
  export declare function saveCacheToDataStore(key: string, value?: HolyNotes.Note[]): Promise<void>;
4
5
  export declare function deleteCacheFromDataStore(key: string): Promise<void>;
5
6
  export declare function getFormatedEntries(): Promise<Record<string, HolyNotes.Note>>;
@@ -1,4 +1,4 @@
1
- import "styles.css?managed";
1
+ import "./styles.css?managed";
2
2
  declare const _default: {
3
3
  name: string;
4
4
  description: string;
@@ -0,0 +1,10 @@
1
+ import "./styles.css";
2
+ import { ModalProps } from "../../utils/modal";
3
+ import { JSX } from "react";
4
+ import { KnownPluginSettingsMap } from "./knownSettings";
5
+ export declare function NewPluginsModal({ modalProps, newPlugins, newSettings }: {
6
+ modalProps: ModalProps;
7
+ newPlugins: Set<string>;
8
+ newSettings: KnownPluginSettingsMap;
9
+ }): JSX.Element;
10
+ export declare function openNewPluginsModal(): Promise<void>;
@@ -0,0 +1,20 @@
1
+ import * as KnownSettings from "./knownSettings";
2
+ import { openNewPluginsModal } from "./NewPluginsModal";
3
+ declare const _default: {
4
+ name: string;
5
+ description: string;
6
+ authors: {
7
+ name: string;
8
+ id: bigint;
9
+ }[];
10
+ readonly displayDescription: string;
11
+ enabledByDefault: true;
12
+ flux: {
13
+ POST_CONNECTION_OPEN(): Promise<void>;
14
+ };
15
+ openNewPluginsModal: typeof openNewPluginsModal;
16
+ KNOWN_PLUGINS_LEGACY_DATA_KEY: string;
17
+ KNOWN_SETTINGS_DATA_KEY: string;
18
+ KnownSettings: typeof KnownSettings;
19
+ } & Record<PropertyKey, any> & import("../../utils/types").Plugin;
20
+ export default _default;
@@ -0,0 +1,10 @@
1
+ export type KnownPluginSettingsMap = Map<string, Set<string>>;
2
+ export declare const KNOWN_PLUGINS_LEGACY_DATA_KEY = "NewPluginsManager_KnownPlugins";
3
+ export declare const KNOWN_SETTINGS_DATA_KEY = "NewPluginsManager_KnownSettings";
4
+ export declare function getKnownSettings(): Promise<Map<string, Set<string>>>;
5
+ export declare function getNewSettings(): Promise<KnownPluginSettingsMap>;
6
+ export declare function getKnownPlugins(): Promise<Set<string>>;
7
+ export declare function getNewPlugins(): Promise<Set<string>>;
8
+ export declare function writeKnownSettings(): Promise<void>;
9
+ export declare function debugWipeSomeData(): Promise<void>;
10
+ export declare function editRawData(patcher: (data: KnownPluginSettingsMap) => (Promise<any> | any)): Promise<void>;
@@ -49,6 +49,7 @@ declare const _default: {
49
49
  };
50
50
  }[];
51
51
  getPlatform(bypass: any, userId?: any): {
52
+ os: string;
52
53
  browser: string;
53
54
  vcIcon: number;
54
55
  } | null;
@@ -1,4 +1,4 @@
1
- import "./index.css";
1
+ import "./styles.css";
2
2
  declare function renderPlexcordToolboxButton(): import("react").JSX.Element;
3
3
  declare const _default: {
4
4
  name: string;
@@ -1,9 +1,5 @@
1
1
  import { OptionType } from "../../utils/types";
2
- declare enum userIDOptions {
3
- displayName = 0,
4
- userName = 1,
5
- userId = 2
6
- }
2
+ import { QuoteFont } from "./types";
7
3
  declare const _default: {
8
4
  name: string;
9
5
  description: string;
@@ -12,39 +8,97 @@ declare const _default: {
12
8
  id: bigint;
13
9
  }[];
14
10
  settings: import("../../utils/types").DefinedSettings<{
15
- userIdentifier: {
11
+ quoteFont: {
16
12
  readonly label: string;
17
13
  readonly description: string;
18
14
  type: OptionType.SELECT;
19
15
  readonly options: ({
20
16
  label: string;
21
- value: userIDOptions;
17
+ value: QuoteFont;
22
18
  default: boolean;
23
19
  } | {
24
20
  label: string;
25
- value: userIDOptions;
21
+ value: QuoteFont;
26
22
  default?: undefined;
27
23
  })[];
28
24
  };
25
+ watermark: {
26
+ readonly label: string;
27
+ readonly description: string;
28
+ type: OptionType.STRING;
29
+ default: string;
30
+ hidden: true;
31
+ };
32
+ grayscale: {
33
+ readonly label: string;
34
+ readonly description: string;
35
+ type: OptionType.BOOLEAN;
36
+ default: true;
37
+ hidden: true;
38
+ };
39
+ showWatermark: {
40
+ readonly label: string;
41
+ readonly description: string;
42
+ type: OptionType.BOOLEAN;
43
+ default: true;
44
+ hidden: true;
45
+ };
46
+ saveAsGif: {
47
+ readonly label: string;
48
+ readonly description: string;
49
+ type: OptionType.BOOLEAN;
50
+ default: false;
51
+ hidden: true;
52
+ };
29
53
  }, import("../../utils/types").SettingsChecks<{
30
- userIdentifier: {
54
+ quoteFont: {
31
55
  readonly label: string;
32
56
  readonly description: string;
33
57
  type: OptionType.SELECT;
34
58
  readonly options: ({
35
59
  label: string;
36
- value: userIDOptions;
60
+ value: QuoteFont;
37
61
  default: boolean;
38
62
  } | {
39
63
  label: string;
40
- value: userIDOptions;
64
+ value: QuoteFont;
41
65
  default?: undefined;
42
66
  })[];
43
67
  };
68
+ watermark: {
69
+ readonly label: string;
70
+ readonly description: string;
71
+ type: OptionType.STRING;
72
+ default: string;
73
+ hidden: true;
74
+ };
75
+ grayscale: {
76
+ readonly label: string;
77
+ readonly description: string;
78
+ type: OptionType.BOOLEAN;
79
+ default: true;
80
+ hidden: true;
81
+ };
82
+ showWatermark: {
83
+ readonly label: string;
84
+ readonly description: string;
85
+ type: OptionType.BOOLEAN;
86
+ default: true;
87
+ hidden: true;
88
+ };
89
+ saveAsGif: {
90
+ readonly label: string;
91
+ readonly description: string;
92
+ type: OptionType.BOOLEAN;
93
+ default: false;
94
+ hidden: true;
95
+ };
44
96
  }>, {}>;
45
97
  readonly displayDescription: string;
46
98
  contextMenus: {
47
99
  message: (children: (import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null)[], { message }: any) => void;
48
100
  };
101
+ start(): Promise<void>;
102
+ stop(): void;
49
103
  } & Record<PropertyKey, any> & import("../../utils/types").Plugin;
50
104
  export default _default;
@@ -0,0 +1,52 @@
1
+ import { User } from "@plexcord/discord-types";
2
+ export declare enum QuoteFont {
3
+ MPlusRounded = "M PLUS Rounded 1c",
4
+ OpenSans = "Open Sans",
5
+ MomoSignature = "Momo Signature",
6
+ Lora = "Lora",
7
+ Merriweather = "Merriweather"
8
+ }
9
+ export interface QuoteImageOptions {
10
+ avatarUrl: string;
11
+ quote: string;
12
+ grayScale: boolean;
13
+ author: User;
14
+ watermark: string;
15
+ showWatermark: boolean;
16
+ saveAsGif: boolean;
17
+ quoteFont: QuoteFont;
18
+ }
19
+ export interface CanvasConfig {
20
+ width: number;
21
+ height: number;
22
+ quoteAreaWidth: number;
23
+ quoteAreaX: number;
24
+ maxContentHeight: number;
25
+ }
26
+ export interface FontSizeCalculation {
27
+ fontSize: number;
28
+ lineHeight: number;
29
+ authorFontSize: number;
30
+ usernameFontSize: number;
31
+ lines: string[];
32
+ totalHeight: number;
33
+ }
34
+ export declare const CANVAS_CONFIG: CanvasConfig;
35
+ export declare const FONT_SIZES: {
36
+ initial: number;
37
+ minimum: number;
38
+ decrement: number;
39
+ lineHeightMultiplier: number;
40
+ authorMultiplier: number;
41
+ usernameMultiplier: number;
42
+ authorMinimum: number;
43
+ usernameMinimum: number;
44
+ watermark: number;
45
+ };
46
+ export declare const SPACING: {
47
+ authorTop: number;
48
+ username: number;
49
+ gradientStart: number;
50
+ gradientWidth: number;
51
+ watermarkPadding: number;
52
+ };
@@ -1,4 +1,11 @@
1
+ import { QuoteImageOptions } from "./types";
2
+ export declare function sizeUpgrade(url: string): string;
1
3
  export declare function canvasToBlob(canvas: HTMLCanvasElement): Promise<Blob>;
2
- export declare function wrapText(ctx: CanvasRenderingContext2D, text: string, x: number, y: number, maxWidth: number, lineHeight: number, preparingSentence: string[], lines: string[]): void;
3
4
  export declare function fetchImageAsBlob(url: string): Promise<Blob>;
4
- export declare function FixUpQuote(quote: string): string;
5
+ export declare function fixUpQuote(quote: string): string;
6
+ export declare function generateFileNamePreview(message: string): string;
7
+ export declare function getFileExtension(saveAsGif: boolean): string;
8
+ export declare function getMimeType(saveAsGif: boolean): string;
9
+ export declare function ensureFontLoaded(): Promise<void>;
10
+ export declare function resetFontLoading(): void;
11
+ export declare function createQuoteImage(options: QuoteImageOptions): Promise<Blob>;
@@ -25,7 +25,7 @@ declare const _default: {
25
25
  readonly description: string;
26
26
  type: OptionType.SELECT;
27
27
  options: {
28
- label: string;
28
+ readonly label: string;
29
29
  value: string;
30
30
  default: boolean;
31
31
  }[];
@@ -43,7 +43,7 @@ declare const _default: {
43
43
  readonly description: string;
44
44
  type: OptionType.SELECT;
45
45
  options: {
46
- label: string;
46
+ readonly label: string;
47
47
  value: string;
48
48
  default: boolean;
49
49
  }[];
@@ -61,7 +61,7 @@ declare const _default: {
61
61
  readonly description: string;
62
62
  type: OptionType.SELECT;
63
63
  options: {
64
- label: string;
64
+ readonly label: string;
65
65
  value: string;
66
66
  default: boolean;
67
67
  }[];
@@ -170,7 +170,7 @@ declare const _default: {
170
170
  readonly description: string;
171
171
  type: OptionType.SELECT;
172
172
  options: {
173
- label: string;
173
+ readonly label: string;
174
174
  value: string;
175
175
  default: boolean;
176
176
  }[];
@@ -188,7 +188,7 @@ declare const _default: {
188
188
  readonly description: string;
189
189
  type: OptionType.SELECT;
190
190
  options: {
191
- label: string;
191
+ readonly label: string;
192
192
  value: string;
193
193
  default: boolean;
194
194
  }[];
@@ -206,7 +206,7 @@ declare const _default: {
206
206
  readonly description: string;
207
207
  type: OptionType.SELECT;
208
208
  options: {
209
- label: string;
209
+ readonly label: string;
210
210
  value: string;
211
211
  default: boolean;
212
212
  }[];