diff options
Diffstat (limited to 'src/webpack')
-rw-r--r-- | src/webpack/common/classes.ts | 24 | ||||
-rw-r--r-- | src/webpack/common/components.ts | 5 | ||||
-rw-r--r-- | src/webpack/common/index.ts | 2 | ||||
-rw-r--r-- | src/webpack/common/types/classes.d.ts | 40 | ||||
-rw-r--r-- | src/webpack/common/types/components.d.ts | 7 | ||||
-rw-r--r-- | src/webpack/common/types/menu.d.ts | 1 |
6 files changed, 75 insertions, 4 deletions
diff --git a/src/webpack/common/classes.ts b/src/webpack/common/classes.ts new file mode 100644 index 0000000..5c1a676 --- /dev/null +++ b/src/webpack/common/classes.ts @@ -0,0 +1,24 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2023 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +import { findByPropsLazy } from "@webpack"; + +import * as t from "./types/classes"; + +export const ModalImageClasses: t.ImageModalClasses = findByPropsLazy("image", "modal"); +export const ButtonWrapperClasses: t.ButtonWrapperClasses = findByPropsLazy("buttonWrapper", "buttonContent"); diff --git a/src/webpack/common/components.ts b/src/webpack/common/components.ts index f308cff..55d3b84 100644 --- a/src/webpack/common/components.ts +++ b/src/webpack/common/components.ts @@ -17,7 +17,7 @@ */ // eslint-disable-next-line path-alias/no-relative -import { filters, findByPropsLazy, waitFor } from "@webpack"; +import { filters, waitFor } from "@webpack"; import { waitForComponent } from "./internal"; import * as t from "./types/components"; @@ -51,11 +51,10 @@ export let Avatar: t.Avatar; /** css colour resolver stuff, no clue what exactly this does, just copied usage from Discord */ export let useToken: t.useToken; +export const MaskedLink = waitForComponent<t.MaskedLink>("MaskedLink", m => m?.type?.toString().includes("MASKED_LINK)")); export const Timestamp = waitForComponent<t.Timestamp>("Timestamp", filters.byCode(".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format")); export const Flex = waitForComponent<t.Flex>("Flex", ["Justify", "Align", "Wrap"]); -export const ButtonWrapperClasses = findByPropsLazy("buttonWrapper", "buttonContent") as Record<string, string>; - waitFor("FormItem", m => { ({ useToken, Card, Button, FormSwitch: Switch, Tooltip, TextInput, TextArea, Text, Select, SearchableSelect, Slider, ButtonLooks, TabBar, Popout, Dialog, Paginator, ScrollerThin, Clickable, Avatar } = m); Forms = m; diff --git a/src/webpack/common/index.ts b/src/webpack/common/index.ts index dff7826..2ad9c54 100644 --- a/src/webpack/common/index.ts +++ b/src/webpack/common/index.ts @@ -16,6 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +export * from "./classes"; export * from "./components"; export * from "./menu"; export * from "./react"; @@ -24,4 +25,3 @@ export * as ComponentTypes from "./types/components.d"; export * as MenuTypes from "./types/menu.d"; export * as UtilTypes from "./types/utils.d"; export * from "./utils"; - diff --git a/src/webpack/common/types/classes.d.ts b/src/webpack/common/types/classes.d.ts new file mode 100644 index 0000000..0d2946f --- /dev/null +++ b/src/webpack/common/types/classes.d.ts @@ -0,0 +1,40 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2023 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +export interface ImageModalClasses { + image: string, + modal: string, + responsiveWidthMobile: string; +} + +export interface ButtonWrapperClasses { + hoverScale: string; + buttonWrapper: string; + button: string; + iconMask: string; + buttonContent: string; + icon: string; + pulseIcon: string; + pulseButton: string; + notificationDot: string; + sparkleContainer: string; + sparkleStar: string; + sparklePlus: string; + sparkle: string; + active: string; +} diff --git a/src/webpack/common/types/components.d.ts b/src/webpack/common/types/components.d.ts index 7bc313c..d6d19fe 100644 --- a/src/webpack/common/types/components.d.ts +++ b/src/webpack/common/types/components.d.ts @@ -398,6 +398,13 @@ export type Paginator = ComponentType<{ hideMaxPage?: boolean; }>; +export type MaskedLink = ComponentType<{ + onClick(): void; + trusted: boolean; + title: string, + href: string; +}>; + export type ScrollerThin = ComponentType<PropsWithChildren<{ className?: string; style?: CSSProperties; diff --git a/src/webpack/common/types/menu.d.ts b/src/webpack/common/types/menu.d.ts index 58ea626..1988617 100644 --- a/src/webpack/common/types/menu.d.ts +++ b/src/webpack/common/types/menu.d.ts @@ -44,6 +44,7 @@ export interface Menu { onChildrenScroll?: Function; childRowHeight?: number; listClassName?: string; + disabled?: boolean; }>; MenuCheckboxItem: RC<{ id: string; |