mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-15 09:33:03 -04:00
MemberCount: fix null safety
and improve types for PopoutPosition Co-Authored-By: fres621 <126067139+fres621@users.noreply.github.com>
This commit is contained in:
parent
99cd423efb
commit
be02baffaa
5 changed files with 22 additions and 20 deletions
18
src/webpack/common/types/components.d.ts
vendored
18
src/webpack/common/types/components.d.ts
vendored
|
@ -91,7 +91,7 @@ export type Tooltip = ComponentType<{
|
|||
/** Tooltip.Colors.BLACK */
|
||||
color?: string;
|
||||
/** TooltipPositions.TOP */
|
||||
position?: string;
|
||||
position?: PopoutPosition;
|
||||
|
||||
tooltipClassName?: string;
|
||||
tooltipContentClassName?: string;
|
||||
|
@ -110,7 +110,7 @@ export type TooltipContainer = ComponentType<PropsWithChildren<{
|
|||
/** Tooltip.Colors.BLACK */
|
||||
color?: string;
|
||||
/** TooltipPositions.TOP */
|
||||
position?: string;
|
||||
position?: PopoutPosition;
|
||||
spacing?: number;
|
||||
|
||||
className?: string;
|
||||
|
@ -252,7 +252,7 @@ export type Select = ComponentType<PropsWithChildren<{
|
|||
look?: 0 | 1;
|
||||
className?: string;
|
||||
popoutClassName?: string;
|
||||
popoutPosition?: "top" | "left" | "right" | "bottom" | "center" | "window_center";
|
||||
popoutPosition?: PopoutPosition;
|
||||
optionClassName?: string;
|
||||
|
||||
autoFocus?: boolean;
|
||||
|
@ -293,7 +293,7 @@ export type SearchableSelect = ComponentType<PropsWithChildren<{
|
|||
className?: string;
|
||||
popoutClassName?: string;
|
||||
wrapperClassName?: string;
|
||||
popoutPosition?: "top" | "left" | "right" | "bottom" | "center" | "window_center";
|
||||
popoutPosition?: PopoutPosition;
|
||||
optionClassName?: string;
|
||||
|
||||
autoFocus?: boolean;
|
||||
|
@ -376,6 +376,8 @@ declare enum PopoutAnimation {
|
|||
FADE = "4"
|
||||
}
|
||||
|
||||
type PopoutPosition = "top" | "bottom" | "left" | "right" | "center" | "window_center";
|
||||
|
||||
export type Popout = ComponentType<{
|
||||
children(
|
||||
thing: {
|
||||
|
@ -387,7 +389,7 @@ export type Popout = ComponentType<{
|
|||
},
|
||||
data: {
|
||||
isShown: boolean;
|
||||
position: string;
|
||||
position: PopoutPosition;
|
||||
}
|
||||
): ReactNode;
|
||||
shouldShow?: boolean;
|
||||
|
@ -395,7 +397,7 @@ export type Popout = ComponentType<{
|
|||
closePopout(): void;
|
||||
isPositioned: boolean;
|
||||
nudge: number;
|
||||
position: string;
|
||||
position: PopoutPosition;
|
||||
setPopoutRef(ref: any): void;
|
||||
updatePosition(): void;
|
||||
}): ReactNode;
|
||||
|
@ -404,13 +406,13 @@ export type Popout = ComponentType<{
|
|||
onRequestClose?(): void;
|
||||
|
||||
/** "center" and others */
|
||||
align?: string;
|
||||
align?: "left" | "right" | "center";
|
||||
/** Popout.Animation */
|
||||
animation?: PopoutAnimation;
|
||||
autoInvert?: boolean;
|
||||
nudgeAlignIntoViewport?: boolean;
|
||||
/** "bottom" and others */
|
||||
position?: string;
|
||||
position?: PopoutPosition;
|
||||
positionKey?: string;
|
||||
spacing?: number;
|
||||
}> & {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue