Merge branch 'immediate-finds' into immediate-finds-modules-proxy
This commit is contained in:
commit
d8ba959d1e
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { filters, find, findByProps, findComponentByCode } from "@webpack";
|
||||
import { findByProps, findComponentByCode } from "@webpack";
|
||||
import type { ComponentType, PropsWithChildren, ReactNode, Ref } from "react";
|
||||
|
||||
import { NoopComponent } from "./react";
|
||||
|
@ -108,7 +108,7 @@ export let ModalContent: Modals["ModalContent"] = NoopComponent;
|
|||
export let ModalFooter: Modals["ModalFooter"] = NoopComponent;
|
||||
export let ModalCloseButton: Modals["ModalCloseButton"] = NoopComponent;
|
||||
|
||||
export const Modals = find<Modals>(filters.byProps("ModalRoot", "ModalCloseButton"), (m: Modals) => {
|
||||
export const Modals = findByProps<Modals>("ModalRoot", "ModalCloseButton", (m: Modals) => {
|
||||
({ ModalRoot, ModalHeader, ModalContent, ModalFooter, ModalCloseButton } = m);
|
||||
|
||||
return m;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
import { NoopComponent } from "@utils/react";
|
||||
|
||||
// eslint-disable-next-line path-alias/no-relative
|
||||
import { filters, find, findComponent, findExportedComponent } from "../api";
|
||||
import { filters, findByProps, findComponent, findComponentByCode, findExportedComponent } from "../api";
|
||||
import * as t from "./types/components";
|
||||
|
||||
export let Card: t.Card = NoopComponent as any;
|
||||
|
@ -45,13 +45,13 @@ export let Avatar: t.Avatar = NoopComponent;
|
|||
export let FocusLock: t.FocusLock = NoopComponent;
|
||||
export let useToken: t.useToken;
|
||||
|
||||
export const MaskedLink = findComponent<t.MaskedLinkProps>(filters.byComponentCode("MASKED_LINK)"));
|
||||
export const Timestamp = findComponent<t.TimestampProps>(filters.byComponentCode(".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format"));
|
||||
export const MaskedLink = findComponentByCode<t.MaskedLinkProps>("MASKED_LINK)");
|
||||
export const Timestamp = findComponentByCode<t.TimestampProps>(".Messages.MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL.format");
|
||||
export const Flex = findComponent(filters.byProps("Justify", "Align", "Wrap")) as t.Flex;
|
||||
|
||||
export const OAuth2AuthorizeModal = findExportedComponent("OAuth2AuthorizeModal");
|
||||
|
||||
export const Forms = find<t.Forms>(filters.byProps("FormItem", "Button"), m => {
|
||||
export const Forms = findByProps<t.Forms>("FormItem", "Button", m => {
|
||||
({
|
||||
useToken,
|
||||
Card,
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
// eslint-disable-next-line path-alias/no-relative
|
||||
import { filters, find, findByProps } from "../api";
|
||||
import { findByProps } from "../api";
|
||||
|
||||
export let useState: typeof React.useState;
|
||||
export let useEffect: typeof React.useEffect;
|
||||
|
@ -28,7 +28,7 @@ export let useCallback: typeof React.useCallback;
|
|||
|
||||
export const ReactDOM = findByProps<typeof import("react-dom") & typeof import("react-dom/client")>("createPortal", "render");
|
||||
|
||||
export const React = find<typeof import("react")>(filters.byProps("useState"), (m: typeof import("react")) => {
|
||||
export const React = findByProps<typeof import("react")>("useState", (m: typeof import("react")) => {
|
||||
({ useEffect, useState, useMemo, useRef, useReducer, useCallback } = m);
|
||||
|
||||
return m;
|
||||
|
|
|
@ -23,7 +23,7 @@ import { Channel } from "discord-types/general";
|
|||
import { _resolveDiscordLoaded, filters, find, findByCode, findByProps, mapMangledModule, waitFor } from "../api";
|
||||
import type * as t from "./types/utils";
|
||||
|
||||
export const FluxDispatcher = find<t.FluxDispatcher>(filters.byProps("dispatch", "subscribe"), (m: t.FluxDispatcher) => {
|
||||
export const FluxDispatcher = findByProps<t.FluxDispatcher>("dispatch", "subscribe", (m: t.FluxDispatcher) => {
|
||||
// Non import call to avoid circular dependency
|
||||
Vencord.Plugins.subscribeAllPluginsFluxEvents(m);
|
||||
|
||||
|
|
Loading…
Reference in a new issue