From 47431f836d5f595007c5c7dc34cafe849656670d Mon Sep 17 00:00:00 2001 From: Federico <38290480+FedeIlLeone@users.noreply.github.com> Date: Sun, 26 May 2024 21:28:12 +0200 Subject: [PATCH] feat(types): update modules 280244 -> 296435 --- cspell.json | 23 +++----- src/renderer/modules/common/fluxDispatcher.ts | 2 +- src/renderer/modules/common/messages.ts | 3 +- .../modules/components/ButtonItem.tsx | 52 ++++--------------- src/renderer/modules/components/Clickable.tsx | 2 + src/renderer/modules/components/FormItem.tsx | 3 ++ src/renderer/modules/components/FormText.tsx | 4 +- src/renderer/modules/components/Loader.tsx | 2 - .../modules/components/SwitchItem.tsx | 12 ++--- src/renderer/modules/components/Text.tsx | 5 ++ src/renderer/modules/components/TextArea.tsx | 15 +++--- src/renderer/modules/components/TextInput.tsx | 10 +++- src/renderer/modules/components/Tooltip.tsx | 12 ++++- src/types/coremods/contextMenu.ts | 17 +++++- src/types/discord.ts | 3 ++ 15 files changed, 81 insertions(+), 84 deletions(-) diff --git a/cspell.json b/cspell.json index 733d3efbc..38d15fe17 100644 --- a/cspell.json +++ b/cspell.json @@ -4,38 +4,30 @@ "dictionaryDefinitions": [], "dictionaries": [], "words": [ - "alertdialog", "APPDATA", "asar", - "Automod", + "automod", "autosize", - "backoff", "blurple", - "Breacrumb", "Chunkdiscord", "codemirror", "cooldown", "coremod", "coremods", "crosspost", - "customitem", "dataurl", "dependants", "devmode", "discordapp", "doas", "dont", - "esbuild", "flatpak", - "flatpaks", "fontawesome", "Fonticons", "Frecency", "getent", "gifv", - "globstar", "gpgsign", - "groupstart", "HighlightJS", "installdir", "Jsonifiable", @@ -50,19 +42,17 @@ "notrack", "outfile", "popout", - "postpublish", "Promisable", "quickcss", - "ratelimited", + "RATELIMITED", "rauenzi", "RDNN", - "Recents", + "recents", "reinject", "replug", "replugged", "resizeable", - "Scroller", - "shopt", + "scroller", "signingkey", "Skema", "skus", @@ -70,10 +60,9 @@ "uninjector", "uninjectors", "Vendicated", - "Webauthn", + "webauthn", "weblate", - "Withs", - "XLARGE" + "Withs" ], "ignoreWords": [], "import": [], diff --git a/src/renderer/modules/common/fluxDispatcher.ts b/src/renderer/modules/common/fluxDispatcher.ts index 7571a40d4..f0c2abcc9 100644 --- a/src/renderer/modules/common/fluxDispatcher.ts +++ b/src/renderer/modules/common/fluxDispatcher.ts @@ -123,7 +123,7 @@ interface Breadcrumb { } interface SentryUtils { - addBreacrumb: (breadcrumb: Breadcrumb) => void; + addBreadcrumb: (breadcrumb: Breadcrumb) => void; } export interface FluxDispatcher { diff --git a/src/renderer/modules/common/messages.ts b/src/renderer/modules/common/messages.ts index 1210cbe62..22e3d000b 100644 --- a/src/renderer/modules/common/messages.ts +++ b/src/renderer/modules/common/messages.ts @@ -474,6 +474,7 @@ interface CreateMessageOptions { flags?: number; nonce?: string; poll?: Poll; + changelogId?: string; } interface UserServer { @@ -488,7 +489,6 @@ interface UserServer { interface MessageUtils { createBotMessage: (options: CreateBotMessageOptions) => Message; createMessage: (options: CreateMessageOptions) => Message; - createNonce: () => string; userRecordToServer: (user: User) => UserServer; } @@ -498,7 +498,6 @@ const MessageUtilsMod = await waitForModule(filters.bySource('username:"Clyde"') const MessageUtils = { createBotMessage: getFunctionBySource(MessageUtilsMod, 'username:"Clyde"'), createMessage: getFunctionBySource(MessageUtilsMod, "createMessage"), - createNonce: getFunctionBySource(MessageUtilsMod, "fromTimestamp"), userRecordToServer: getFunctionBySource(MessageUtilsMod, "global_name:"), } as MessageUtils; diff --git a/src/renderer/modules/components/ButtonItem.tsx b/src/renderer/modules/components/ButtonItem.tsx index e72ade372..0f4fd6ba9 100644 --- a/src/renderer/modules/components/ButtonItem.tsx +++ b/src/renderer/modules/components/ButtonItem.tsx @@ -5,19 +5,17 @@ import { waitForProps } from "../webpack"; interface ButtonProps extends React.ComponentPropsWithoutRef<"button"> { look?: string; - size?: string; color?: string; - borderColor?: string; - hover?: string; + size?: string; fullWidth?: boolean; grow?: boolean; submitting?: boolean; - submittingStartedLabel?: string; - submittingFinishedLabel?: string; + wrapperClassName?: string; + innerClassName?: string; buttonRef?: React.Ref; focusProps?: Record; - innerClassName?: string; - wrapperClassName?: string; + submittingStartedLabel?: string; + submittingFinishedLabel?: string; } interface Path { @@ -37,10 +35,8 @@ interface LinkProps extends Omit, "href"> { interface ButtonLinkProps extends LinkProps { look?: string; - size?: string; color?: string; - borderColor?: string; - hover?: string; + size?: string; fullWidth?: boolean; grow?: boolean; innerClassName?: string; @@ -48,50 +44,20 @@ interface ButtonLinkProps extends LinkProps { export type ButtonType = React.FC> & { Link: React.FC>; - Looks: Record<"FILLED" | "INVERTED" | "OUTLINED" | "LINK" | "BLANK", string>; + Looks: Record<"FILLED" | "OUTLINED" | "LINK" | "BLANK", string>; Colors: Record< | "BRAND" + | "BRAND_INVERTED" | "RED" | "GREEN" - | "YELLOW" | "PRIMARY" | "LINK" | "WHITE" | "TRANSPARENT" - | "BRAND_NEW" | "CUSTOM", string >; - BorderColors: Record< - | "BRAND" - | "RED" - | "GREEN" - | "YELLOW" - | "PRIMARY" - | "LINK" - | "WHITE" - | "BLACK" - | "TRANSPARENT" - | "BRAND_NEW", - string - >; - Hovers: Record< - | "DEFAULT" - | "BRAND" - | "RED" - | "GREEN" - | "YELLOW" - | "PRIMARY" - | "LINK" - | "WHITE" - | "BLACK" - | "TRANSPARENT", - string - >; - Sizes: Record< - "NONE" | "TINY" | "SMALL" | "MEDIUM" | "LARGE" | "XLARGE" | "MIN" | "MAX" | "ICON", - string - >; + Sizes: Record<"NONE" | "TINY" | "SMALL" | "MEDIUM" | "LARGE" | "MIN" | "MAX" | "ICON", string>; }; export const { Button } = components; diff --git a/src/renderer/modules/components/Clickable.tsx b/src/renderer/modules/components/Clickable.tsx index f840448ec..7ca5a8225 100644 --- a/src/renderer/modules/components/Clickable.tsx +++ b/src/renderer/modules/components/Clickable.tsx @@ -4,6 +4,8 @@ import components from "../common/components"; // TODO: generic type for tags? type ClickableProps = React.ComponentPropsWithoutRef<"div"> & { tag?: keyof JSX.IntrinsicElements; + focusProps?: Record; + innerRef?: React.Ref; ignoreKeyPress?: boolean; }; diff --git a/src/renderer/modules/components/FormItem.tsx b/src/renderer/modules/components/FormItem.tsx index fa1604d10..620181bf6 100644 --- a/src/renderer/modules/components/FormItem.tsx +++ b/src/renderer/modules/components/FormItem.tsx @@ -7,9 +7,12 @@ interface FormItemCompProps extends Omit, children: React.ReactNode; title?: React.ReactNode; error?: React.ReactNode; + faded?: boolean; disabled?: boolean; required?: boolean; tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "label" | "legend"; + titleId?: string; + errorId?: string; titleClassName?: string; } diff --git a/src/renderer/modules/components/FormText.tsx b/src/renderer/modules/components/FormText.tsx index 72569a152..c7caaa4aa 100644 --- a/src/renderer/modules/components/FormText.tsx +++ b/src/renderer/modules/components/FormText.tsx @@ -12,12 +12,10 @@ export type FormTextTypeKey = | "SUCCESS" | string; -interface FormTextProps { +interface FormTextProps extends React.ComponentPropsWithoutRef<"div"> { type?: string; disabled?: boolean; selectable?: boolean; - style?: React.CSSProperties; - className?: string; } export type FormTextCompType = React.FC>; diff --git a/src/renderer/modules/components/Loader.tsx b/src/renderer/modules/components/Loader.tsx index 5c08275cf..8604c60db 100644 --- a/src/renderer/modules/components/Loader.tsx +++ b/src/renderer/modules/components/Loader.tsx @@ -12,9 +12,7 @@ const Types = { interface GenericLoaderProps { animated?: boolean; - className?: string; itemClassName?: string; - style?: React.CSSProperties; } type LoaderProps = GenericLoaderProps & { diff --git a/src/renderer/modules/components/SwitchItem.tsx b/src/renderer/modules/components/SwitchItem.tsx index e07181873..4bcaf79d0 100644 --- a/src/renderer/modules/components/SwitchItem.tsx +++ b/src/renderer/modules/components/SwitchItem.tsx @@ -2,20 +2,20 @@ import type React from "react"; import components from "../common/components"; interface SwitchProps { - checked: boolean; - onChange: (value: boolean) => void; + checked?: boolean; + onChange?: (value: boolean, event: React.ChangeEvent) => void; disabled?: boolean; id?: string; - innerRef?: React.Ref; + innerRef?: React.Ref; focusProps?: Record; className?: string; } -export type SwitchType = React.FC>; +export type SwitchType = React.FC; interface SwitchItemProps { - value: boolean; - onChange: (value: boolean) => void; + value?: boolean; + onChange?: (value: boolean, event: React.ChangeEvent) => void; note?: string; tooltipNote?: string; disabled?: boolean; diff --git a/src/renderer/modules/components/Text.tsx b/src/renderer/modules/components/Text.tsx index c9f37167c..4e377e4a1 100644 --- a/src/renderer/modules/components/Text.tsx +++ b/src/renderer/modules/components/Text.tsx @@ -59,6 +59,10 @@ export type Variant = | "redesign/message-preview/medium" | "redesign/message-preview/semibold" | "redesign/message-preview/bold" + | "redesign/channel-title/normal" + | "redesign/channel-title/medium" + | "redesign/channel-title/semibold" + | "redesign/channel-title/bold" | "display-sm" | "display-md" | "display-lg" @@ -71,6 +75,7 @@ interface TextProps extends React.ComponentPropsWithoutRef<"div"> { selectable?: boolean; tabularNumbers?: boolean; lineClamp?: number; + scaleFontToUserSetting?: boolean; } interface CustomTextProps extends TextProps { diff --git a/src/renderer/modules/components/TextArea.tsx b/src/renderer/modules/components/TextArea.tsx index ba1a2ac4b..26730a97c 100644 --- a/src/renderer/modules/components/TextArea.tsx +++ b/src/renderer/modules/components/TextArea.tsx @@ -11,6 +11,7 @@ interface TextAreaProps { autosize?: boolean; spellCheck?: boolean; showCharacterCount?: boolean; + showCharacterCountFullPadding?: boolean; showRemainingCharacterCount?: boolean; minLength?: number; maxLength?: number; @@ -20,13 +21,15 @@ interface TextAreaProps { error?: string; value?: string; id?: string; - inputRef?: React.Ref; + defaultDirty?: boolean; + inputRef?: React.Ref; className?: string; - onChange?: (value: string) => void; - onInvalid?: React.FormEventHandler; - onFocus?: React.FocusEventHandler; - onBlur?: React.FocusEventHandler; - onKeyDown?: React.KeyboardEventHandler; + onChange?: (value: string, name: string) => void; + onInvalid?: React.FormEventHandler; + onFocus?: (event: React.FocusEvent, name: string) => void; + onBlur?: (event: React.FocusEvent, name: string) => void; + onKeyDown?: React.KeyboardEventHandler; + "aria-labelledby"?: string; } export type TextAreaType = React.ComponentClass & { diff --git a/src/renderer/modules/components/TextInput.tsx b/src/renderer/modules/components/TextInput.tsx index cab450d88..7d6f0525c 100644 --- a/src/renderer/modules/components/TextInput.tsx +++ b/src/renderer/modules/components/TextInput.tsx @@ -2,7 +2,10 @@ import type React from "react"; import components from "../common/components"; interface TextInputProps - extends Omit, "size" | "onChange"> { + extends Omit< + React.ComponentPropsWithoutRef<"input">, + "size" | "onChange" | "onFocus" | "onBlur" + > { editable?: boolean; inputPrefix?: string; prefixElement?: React.ReactNode; @@ -11,7 +14,10 @@ interface TextInputProps inputRef?: React.Ref; focusProps?: Record; inputClassName?: string; - onChange?: (value: string) => void; + defaultDirty?: boolean; + onChange?: (value: string, name: string) => void; + onFocus?: (event: React.FocusEvent, name: string) => void; + onBlur?: (event: React.FocusEvent, name: string) => void; } export type TextInputType = React.ComponentClass & { diff --git a/src/renderer/modules/components/Tooltip.tsx b/src/renderer/modules/components/Tooltip.tsx index 483d6fdbc..e28bc96c5 100644 --- a/src/renderer/modules/components/Tooltip.tsx +++ b/src/renderer/modules/components/Tooltip.tsx @@ -22,7 +22,16 @@ interface TooltipEnums { Aligns: typeof Aligns; Positions: typeof Positions; Colors: Record< - "PRIMARY" | "BLACK" | "GREY" | "BRAND" | "GREEN" | "YELLOW" | "RED" | "CUSTOM" | "PREMIUM", + | "PRIMARY" + | "NESTED" + | "BLACK" + | "GREY" + | "BRAND" + | "GREEN" + | "YELLOW" + | "RED" + | "CUSTOM" + | "PREMIUM", string >; } @@ -45,6 +54,7 @@ interface BaseTooltipProps { tooltipClassName?: string; tooltipContentClassName?: string; style?: React.CSSProperties; + tooltipStyle?: React.CSSProperties; onTooltipShow?: () => void; onAnimationRest?: (result: unknown, spring: unknown, item?: unknown) => void; } diff --git a/src/types/coremods/contextMenu.ts b/src/types/coremods/contextMenu.ts index f2a1ee848..ff05ada57 100644 --- a/src/types/coremods/contextMenu.ts +++ b/src/types/coremods/contextMenu.ts @@ -29,16 +29,21 @@ export enum ContextMenuTypes { ActivityShelfItemContext = "activity-shelf-item-context", AddQuestions = "add-questions", ApplicationDirectoryProfile = "application-directory-profile", + AttachmentLinkContext = "attachment-link-context", /** Right-click mute or deafen buttons */ AudioDeviceContext = "audio-device-context", AutomodRuleContext = "automod-rule-context", ChannelAttach = "channel-attach", ChannelAutocomplete = "channel-autocomplete", ChannelCallOverflowPopout = "channel-call-overflow-popout", + ChannelNotificationCustomSettingsItems = "ChannelNotificationCustomSettingsItems", + ClipsContext = "clips-context", + ClipsMoreOptions = "clips-more-options", /** Right-click channel */ ChannelContext = "channel-context", /** Right-click a channel mention */ ChannelMentionContext = "channel-mention-context", + ChannelSummariesContextMenu = "channel-summaries-context-menu", ComponentButton = "component-button", CopyId = "copy-id", /** Right-click a role */ @@ -79,8 +84,10 @@ export enum ContextMenuTypes { ManageMultiAccount = "manage-multi-account", ManageStreams = "manage-streams", MemberApplicationContextMenu = "member-application-context-menu", + MemberListSettingsMenu = "member-list-settings-menu", MemberSafetyFlags = "member-safety-flags", - MemberSafetyOptions = "member-safety-options", + MembersTableJoinMethodMenu = "members-table-join-method-menu", + MembersTableSortMenu = "members-table-sort-menu", MentionsFilter = "mentions-filter", /** Click the triple dots on a message popover */ MessageActions = "message-actions", @@ -92,7 +99,9 @@ export enum ContextMenuTypes { NowPlayingMenu = "now-playing-menu", Overlay = "overlay", PipMenu = "pip-menu", + PollMediaEditMenu = "poll-media-edit-menu", ProgressBarContext = "progress-bar-context", + QuestsEntry = "quests-entry", RecentsNotifications = "recents-notifications", RecentsThreadNotifications = "recents-thread-notifications", /** Right-click "Server Subscriptions" */ @@ -100,9 +109,11 @@ export enum ContextMenuTypes { RtcChannel = "rtc-channel", SearchResults = "search-results", SetImageForAction = "set-image-for-action", + SignupButtonContext = "signup-button-context", SortAndView = "sort-and-view", SoundButtonContext = "sound-button-context", StaffHelpPopout = "staff-help-popout", + StaffOnlyEntryDebug = "staff-only-entry-debug", StageChannelCallOverflowPopout = "stage-channel-call-overflow-popout", StatusPicker = "status-picker", StreamContext = "stream-context", @@ -114,9 +125,13 @@ export enum ContextMenuTypes { /** Right-click a thread */ ThreadContext = "thread-context", TransferMenu = "transfer-menu", + UnknownUserContext = "unknown-user-context", /** Right-click user */ UserContext = "user-context", UserProfileActions = "user-profile-actions", + UserProfileFriendRequestButtons = "user-profile-friend-request-buttons", + UserProfileOverflowMenu = "user-profile-overflow-menu", + UserSettingsChangeAvatar = "user-settings-change-avatar", /** Right-click settings */ UserSettingsCog = "user-settings-cog", VideoBackgroundContext = "video-background-context", diff --git a/src/types/discord.ts b/src/types/discord.ts index 4eedc3783..fc9b9ae65 100644 --- a/src/types/discord.ts +++ b/src/types/discord.ts @@ -98,6 +98,9 @@ export enum MessageEmbedTypes { POST_PREVIEW = "post_preview", GIFT = "gift", SAFETY_POLICY_NOTICE = "safety_policy_notice", + SAFETY_SYSTEM_NOTIFICATION = "safety_system_notification", + VOICE_CHANNEL = "voice_channel", + GAMING_PROFILE = "gaming_profile", } export interface APIEmbed {