diff --git a/src/utils/modal.tsx b/src/utils/modal.tsx
index 4c9962563..800dcc092 100644
--- a/src/utils/modal.tsx
+++ b/src/utils/modal.tsx
@@ -19,7 +19,6 @@
import { filters, find, findByProps, findExportedComponent } from "@webpack";
import type { ComponentType, PropsWithChildren, ReactNode, Ref } from "react";
-
export const enum ModalSize {
SMALL = "small",
MEDIUM = "medium",
diff --git a/src/utils/react.tsx b/src/utils/react.tsx
index f31549f19..abae97c53 100644
--- a/src/utils/react.tsx
+++ b/src/utils/react.tsx
@@ -22,8 +22,6 @@ import { checkIntersecting } from "./misc";
export * from "./lazyReact";
-export const NoopComponent = () => null;
-
/**
* Check if an element is on screen
* @param intersectOnly If `true`, will only update the state when the element comes into view
diff --git a/src/webpack/common/classes.ts b/src/webpack/common/classes.ts
index 7a9eee949..ea41bd693 100644
--- a/src/webpack/common/classes.ts
+++ b/src/webpack/common/classes.ts
@@ -16,9 +16,9 @@
* along with this program. If not, see .
*/
-import { find, findByProps } from "@webpack";
-
+// eslint-disable-next-line path-alias/no-relative
+import { find, findByProps } from "../webpack";
import * as t from "./types/classes";
-export const ModalImageClasses: t.ImageModalClasses = find(m => m.image && m.modal && !m.applicationIcon);
-export const ButtonWrapperClasses: t.ButtonWrapperClasses = findByProps("buttonWrapper", "buttonContent");
+export const ModalImageClasses = find(m => m.image && m.modal && !m.applicationIcon);
+export const ButtonWrapperClasses = findByProps("buttonWrapper", "buttonContent");
diff --git a/src/webpack/common/components.ts b/src/webpack/common/components.ts
index cdf12d997..94f5389bd 100644
--- a/src/webpack/common/components.ts
+++ b/src/webpack/common/components.ts
@@ -17,17 +17,9 @@
*/
// eslint-disable-next-line path-alias/no-relative
-import { filters, findComponent, findExportedComponent, waitFor } from "@webpack";
-
+import { filters, find, findComponent, findExportedComponent } from "../webpack";
import * as t from "./types/components";
-export let Forms = {} as {
- FormTitle: t.FormTitle,
- FormSection: t.FormSection,
- FormDivider: t.FormDivider,
- FormText: t.FormText,
-};
-
export let Card: t.Card;
export let Button: t.Button;
export let Switch: t.Switch;
@@ -58,8 +50,7 @@ export const Flex = findComponent(filters.byProps("Justify", "Align
export const OAuth2AuthorizeModal = findExportedComponent("OAuth2AuthorizeModal");
-waitFor(filters.byProps("FormItem", "Button"), m => {
- Forms = m;
+export const Forms = find(filters.byProps("FormItem", "Button"), m => {
({
useToken,
Card,
@@ -83,4 +74,11 @@ waitFor(filters.byProps("FormItem", "Button"), m => {
FocusLock,
Heading
} = m);
-});
+
+ return m;
+}) as {
+ FormTitle: t.FormTitle,
+ FormSection: t.FormSection,
+ FormDivider: t.FormDivider,
+ FormText: t.FormText,
+};
diff --git a/src/webpack/common/menu.ts b/src/webpack/common/menu.ts
index a722cf242..aada18f58 100644
--- a/src/webpack/common/menu.ts
+++ b/src/webpack/common/menu.ts
@@ -23,4 +23,3 @@ import type * as t from "./types/menu";
export const Menu = findByProps("MenuItem", "MenuSliderControl");
export const ContextMenuApi = findByProps("closeContextMenu", "openContextMenu");
-
diff --git a/src/webpack/common/react.ts b/src/webpack/common/react.ts
index f71517f2c..4a66c4817 100644
--- a/src/webpack/common/react.ts
+++ b/src/webpack/common/react.ts
@@ -17,9 +17,8 @@
*/
// eslint-disable-next-line path-alias/no-relative
-import { filters, findByProps,waitFor } from "../webpack";
+import { filters, find, findByProps } from "../webpack";
-export let React: typeof import("react");
export let useState: typeof React.useState;
export let useEffect: typeof React.useEffect;
export let useMemo: typeof React.useMemo;
@@ -29,7 +28,8 @@ export let useCallback: typeof React.useCallback;
export const ReactDOM = findByProps("createPortal", "render");
-waitFor(filters.byProps("useState"), m => {
- React = m;
- ({ useEffect, useState, useMemo, useRef, useReducer, useCallback } = React);
+export const React = find(filters.byProps("useState"), m => {
+ ({ useEffect, useState, useMemo, useRef, useReducer, useCallback } = m);
+
+ return m;
});
diff --git a/src/webpack/common/settingsStores.ts b/src/webpack/common/settingsStores.ts
index e4da26b31..326a09019 100644
--- a/src/webpack/common/settingsStores.ts
+++ b/src/webpack/common/settingsStores.ts
@@ -4,12 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
-import { findByProps } from "@webpack";
-
+// eslint-disable-next-line path-alias/no-relative
+import { findByProps } from "../webpack";
import * as t from "./types/settingsStores";
-
-export const TextAndImagesSettingsStores = findByProps("MessageDisplayCompact") as Record;
-export const StatusSettingsStores = findByProps("ShowCurrentGame") as Record;
+export const TextAndImagesSettingsStores = findByProps>("MessageDisplayCompact");
+export const StatusSettingsStores = findByProps>("ShowCurrentGame");
export const UserSettingsActionCreators = findByProps("PreloadedUserSettingsActionCreators");
diff --git a/src/webpack/common/stores.ts b/src/webpack/common/stores.ts
index 5ab4651e8..d7e7cd60a 100644
--- a/src/webpack/common/stores.ts
+++ b/src/webpack/common/stores.ts
@@ -22,7 +22,7 @@ import type * as Stores from "discord-types/stores";
import { findByProps, findStore } from "../webpack";
import * as t from "./types/stores";
-export const Flux: t.Flux = findByProps("connectStores");
+export const Flux = findByProps("connectStores");
export type GenericStore = t.FluxStore & Record;
@@ -39,26 +39,26 @@ export const MessageStore = findStore("MessageStore") as Omit("PermissionStore");
+export const GuildChannelStore = findStore("GuildChannelStore");
+export const ReadStateStore = findStore("ReadStateStore");
+export const PresenceStore = findStore("PresenceStore");
-export const GuildStore: t.GuildStore = findStore("GuildStore");
-export const UserStore: Stores.UserStore & t.FluxStore = findStore("UserStore");
-export const UserProfileStore: GenericStore = findStore("UserProfileStore");
-export const SelectedChannelStore: Stores.SelectedChannelStore & t.FluxStore = findStore("SelectedChannelStore");
-export const SelectedGuildStore: t.FluxStore & Record = findStore("SelectedGuildStore");
-export const ChannelStore: Stores.ChannelStore & t.FluxStore = findStore("ChannelStore");
-export const GuildMemberStore: Stores.GuildMemberStore & t.FluxStore = findStore("GuildMemberStore");
+export const GuildStore = findStore("GuildStore");
+export const UserStore = findStore("UserStore");
+export const UserProfileStore = findStore("UserProfileStore");
+export const SelectedChannelStore = findStore("SelectedChannelStore");
+export const SelectedGuildStore = findStore("SelectedGuildStore");
+export const ChannelStore = findStore("ChannelStore");
+export const GuildMemberStore = findStore("GuildMemberStore");
export const RelationshipStore = findStore("RelationshipStore") as Stores.RelationshipStore & t.FluxStore & {
/** Get the date (as a string) that the relationship was created */
getSince(userId: string): string;
};
-export const EmojiStore: t.EmojiStore = findStore("EmojiStore");
-export const WindowStore: t.WindowStore = findStore("WindowStore");
-export const DraftStore: t.DraftStore = findStore("DraftStore");
+export const EmojiStore = findStore("EmojiStore");
+export const WindowStore = findStore("WindowStore");
+export const DraftStore = findStore("DraftStore");
/**
* React hook that returns stateful data for one or more stores
diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts
index 3f50c3054..07fd2f7df 100644
--- a/src/webpack/common/utils.ts
+++ b/src/webpack/common/utils.ts
@@ -90,7 +90,6 @@ export const Toasts = {
}
};
-// This is the same module but this is easier
waitFor(filters.byCode("showToast"), m => {
Toasts.show = m.showToast;
Toasts.pop = m.popToast;