mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 01:46:23 +00:00
how many times?
This commit is contained in:
parent
ddeca192b7
commit
19c87b6a7a
3 changed files with 4 additions and 1 deletions
|
@ -30,6 +30,7 @@ export function makeLazy<T>(factory: () => T, attempts = 5, { isIndirect = false
|
||||||
};
|
};
|
||||||
|
|
||||||
getter.$$vencordLazyFailed = () => tries === attempts;
|
getter.$$vencordLazyFailed = () => tries === attempts;
|
||||||
|
|
||||||
return getter;
|
return getter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ export type LazyComponentType<P extends AnyRecord = AnyRecord> = React.FunctionC
|
||||||
[SYM_LAZY_COMPONENT_INNER]: () => AnyComponentType<P> | null;
|
[SYM_LAZY_COMPONENT_INNER]: () => AnyComponentType<P> | null;
|
||||||
};
|
};
|
||||||
export type AnyLazyComponentType<P extends AnyRecord = AnyRecord> = LazyComponentType<P & AnyRecord>;
|
export type AnyLazyComponentType<P extends AnyRecord = AnyRecord> = LazyComponentType<P & AnyRecord>;
|
||||||
|
export type AnyLazyComponentTypeWithChildren<P extends AnyRecord = AnyRecord> = AnyLazyComponentType<React.PropsWithChildren<P>>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A lazy component. The factory method is called on first render.
|
* A lazy component. The factory method is called on first render.
|
||||||
|
|
3
src/webpack/common/types/components.d.ts
vendored
3
src/webpack/common/types/components.d.ts
vendored
|
@ -16,6 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { AnyLazyComponentTypeWithChildren } from "@utils/lazyReact";
|
||||||
import type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react";
|
import type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react";
|
||||||
|
|
||||||
import { IconNames } from "./iconNames";
|
import { IconNames } from "./iconNames";
|
||||||
|
@ -371,7 +372,7 @@ export type Slider = ComponentType<PropsWithChildren<{
|
||||||
}>>;
|
}>>;
|
||||||
|
|
||||||
// TODO - type maybe idk probably not that useful other than the constants
|
// TODO - type maybe idk probably not that useful other than the constants
|
||||||
export type Flex = ComponentType<PropsWithChildren<any>> & {
|
export type Flex = AnyLazyComponentTypeWithChildren & {
|
||||||
Align: Record<"START" | "END" | "CENTER" | "STRETCH" | "BASELINE", string>;
|
Align: Record<"START" | "END" | "CENTER" | "STRETCH" | "BASELINE", string>;
|
||||||
Direction: Record<"VERTICAL" | "HORIZONTAL" | "HORIZONTAL_REVERSE", string>;
|
Direction: Record<"VERTICAL" | "HORIZONTAL" | "HORIZONTAL_REVERSE", string>;
|
||||||
Justify: Record<"START" | "END" | "CENTER" | "BETWEEN" | "AROUND", string>;
|
Justify: Record<"START" | "END" | "CENTER" | "BETWEEN" | "AROUND", string>;
|
||||||
|
|
Loading…
Reference in a new issue