diff --git a/src/utils/lazyReact.tsx b/src/utils/lazyReact.tsx index 20988e1ec..ff90179b6 100644 --- a/src/utils/lazyReact.tsx +++ b/src/utils/lazyReact.tsx @@ -6,7 +6,7 @@ import { makeLazy } from "./lazy"; -export type LazyComponentType = React.ComponentType & Record; +export type LazyComponentType = React.ComponentType & Record; export const SYM_LAZY_COMPONENT_INNER = Symbol.for("vencord.lazyComponent.inner"); @@ -17,7 +17,7 @@ export const SYM_LAZY_COMPONENT_INNER = Symbol.for("vencord.lazyComponent.inner" * @param attempts How many times to try to get the component before giving up * @returns Result of factory function */ -export function LazyComponent(factory: () => LazyComponentType, attempts = 5) { +export function LazyComponent(factory: () => LazyComponentType, attempts = 5) { const get = makeLazy(factory, attempts, { isIndirect: true }); let InnerComponent = null as LazyComponentType | null; diff --git a/src/webpack/webpack.tsx b/src/webpack/webpack.tsx index 30527d85d..e073db974 100644 --- a/src/webpack/webpack.tsx +++ b/src/webpack/webpack.tsx @@ -204,7 +204,7 @@ export function find(filter: FilterFn, callback: (module: ModuleE * @param parse A function that takes the found component as its first argument and returns a component. Useful if you want to wrap the found component in something. Defaults to the original component * @returns The component if found, or a noop component */ -export function findComponent(filter: FilterFn, parse: (component: ModuleExports) => LazyComponentType = m => m, { isIndirect = false }: { isIndirect?: boolean; } = {}) { +export function findComponent(filter: FilterFn, parse: (component: ModuleExports) => LazyComponentType = m => m, { isIndirect = false }: { isIndirect?: boolean; } = {}) { if (typeof filter !== "function") throw new Error("Invalid filter. Expected a function got " + typeof filter); if (typeof parse !== "function") @@ -249,7 +249,7 @@ export function findComponent(filter: FilterFn, parse: (c * @param parse A function that takes the found component as its first argument and returns a component. Useful if you want to wrap the found component in something. Defaults to the original component * @returns The component if found, or a noop component */ -export function findExportedComponent(...props: string[] | [...string[], (component: ModuleExports) => LazyComponentType]) { +export function findExportedComponent(...props: string[] | [...string[], (component: ModuleExports) => LazyComponentType]) { const parse = (typeof props.at(-1) === "function" ? props.pop() : m => m) as (component: ModuleExports) => LazyComponentType; const newProps = props as string[]; @@ -294,7 +294,7 @@ export function findExportedComponent(...props: string[] * @param parse A function that takes the found component as its first argument and returns a component. Useful if you want to wrap the found component in something. Defaults to the original component * @returns The component if found, or a noop component */ -export function findComponentByCode(...code: string[] | [...string[], (component: ModuleExports) => LazyComponentType]) { +export function findComponentByCode(...code: string[] | [...string[], (component: ModuleExports) => LazyComponentType]) { const parse = (typeof code.at(-1) === "function" ? code.pop() : m => m) as (component: ModuleExports) => LazyComponentType; const newCode = code as string[]; @@ -524,7 +524,7 @@ export function webpackDependantLazy(factory: () => T, attempts?: * @param attempts How many times to try to get the component before giving up * @returns Result of factory function */ -export function webpackDependantLazyComponent(factory: () => any, attempts?: number) { +export function webpackDependantLazyComponent(factory: () => any, attempts?: number) { if (IS_REPORTER) webpackSearchHistory.push(["webpackDependantLazyComponent", [factory]]); return LazyComponent(factory, attempts);