Update @types/react

This commit is contained in:
Bill 2022-05-02 02:34:10 -04:00
parent 5c2ead3481
commit 1e6d8e490b
20 changed files with 601 additions and 515 deletions

View File

@ -15,7 +15,8 @@
"@fortawesome/fontawesome-svg-core": "^6.1.0", "@fortawesome/fontawesome-svg-core": "^6.1.0",
"@fortawesome/free-solid-svg-icons": "^6.1.0", "@fortawesome/free-solid-svg-icons": "^6.1.0",
"@fortawesome/react-fontawesome": "^0.1.17", "@fortawesome/react-fontawesome": "^0.1.17",
"@nitrots/nitro-renderer": "^1.2.3", "@nitrots/nitro-renderer": "^1.2.5",
"@types/react-transition-group": "^4.4.4",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"classnames": "^2.3.1", "classnames": "^2.3.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
@ -33,14 +34,15 @@
"use-between": "^1.3.1" "use-between": "^1.3.1"
}, },
"resolutions": { "resolutions": {
"react-error-overlay": "6.0.9" "react-error-overlay": "6.0.9",
"@types/react": "^18.0.8",
"@types/react-dom": "^18.0.3"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^12.20.19", "@types/node": "^12.20.19",
"@types/react": "^17.0.15", "@types/react": "^18.0.8",
"@types/react-dom": "^17.0.9", "@types/react-dom": "^18.0.3",
"@types/react-slider": "^1.3.1", "@types/react-slider": "^1.3.1",
"@types/react-transition-group": "^4.4.2",
"@types/react-virtualized": "^9.21.13", "@types/react-virtualized": "^9.21.13",
"@typescript-eslint/eslint-plugin": "^5.17.0", "@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0", "@typescript-eslint/parser": "^5.17.0",

View File

@ -1,4 +1,4 @@
import { CSSProperties, DetailedHTMLProps, FC, HTMLAttributes, MutableRefObject, useMemo } from 'react'; import { CSSProperties, DetailedHTMLProps, FC, HTMLAttributes, MutableRefObject, ReactNode, useMemo } from 'react';
import { ColorVariantType, DisplayType, FloatType, OverflowType, PositionType } from './types'; import { ColorVariantType, DisplayType, FloatType, OverflowType, PositionType } from './types';
export interface BaseProps<T = HTMLElement> extends DetailedHTMLProps<HTMLAttributes<T>, T> export interface BaseProps<T = HTMLElement> extends DetailedHTMLProps<HTMLAttributes<T>, T>
@ -17,11 +17,12 @@ export interface BaseProps<T = HTMLElement> extends DetailedHTMLProps<HTMLAttrib
visible?: boolean; visible?: boolean;
textColor?: ColorVariantType; textColor?: ColorVariantType;
classNames?: string[]; classNames?: string[];
children?: ReactNode;
} }
export const Base: FC<BaseProps<HTMLDivElement>> = props => export const Base: FC<BaseProps<HTMLDivElement>> = props =>
{ {
const { ref = null, innerRef = null, display = null, fit = false, grow = false, shrink = false, fullWidth = false, fullHeight = false, overflow = null, position = null, float = null, pointer = false, visible = null, textColor = null, classNames = [], className = '', style = {}, ...rest } = props; const { ref = null, innerRef = null, display = null, fit = false, grow = false, shrink = false, fullWidth = false, fullHeight = false, overflow = null, position = null, float = null, pointer = false, visible = null, textColor = null, classNames = [], className = '', style = {}, children = null, ...rest } = props;
const getClassNames = useMemo(() => const getClassNames = useMemo(() =>
{ {
@ -72,5 +73,9 @@ export const Base: FC<BaseProps<HTMLDivElement>> = props =>
return newStyle; return newStyle;
}, [ style ]); }, [ style ]);
return <div ref={ innerRef } className={ getClassName } style={ getStyle } { ...rest } />; return (
<div ref={ innerRef } className={ getClassName } style={ getStyle } { ...rest }>
{ children }
</div>
);
} }

View File

@ -1,5 +1,5 @@
import { MouseEventType, TouchEventType } from '@nitrots/nitro-renderer'; import { MouseEventType, TouchEventType } from '@nitrots/nitro-renderer';
import { CSSProperties, FC, Key, MouseEvent as ReactMouseEvent, TouchEvent as ReactTouchEvent, useCallback, useEffect, useRef, useState } from 'react'; import { CSSProperties, FC, Key, MouseEvent as ReactMouseEvent, ReactNode, TouchEvent as ReactTouchEvent, useCallback, useEffect, useRef, useState } from 'react';
import { createPortal } from 'react-dom'; import { createPortal } from 'react-dom';
import { Base } from '..'; import { Base } from '..';
import { DraggableWindowPosition } from './DraggableWindowPosition'; import { DraggableWindowPosition } from './DraggableWindowPosition';
@ -18,6 +18,7 @@ export interface DraggableWindowProps
dragStyle?: CSSProperties; dragStyle?: CSSProperties;
offsetLeft?: number; offsetLeft?: number;
offsetTop?: number; offsetTop?: number;
children?: ReactNode;
} }
export const DraggableWindow: FC<DraggableWindowProps> = props => export const DraggableWindow: FC<DraggableWindowProps> = props =>

View File

@ -1,16 +1,17 @@
import { ColorConverter, IRoomRenderingCanvas, RoomPreviewer, TextureUtils } from '@nitrots/nitro-renderer'; import { ColorConverter, IRoomRenderingCanvas, RoomPreviewer, TextureUtils } from '@nitrots/nitro-renderer';
import { FC, MouseEvent, useCallback, useEffect, useRef, useState } from 'react'; import { FC, MouseEvent, ReactNode, useCallback, useEffect, useRef, useState } from 'react';
import { GetNitroInstance } from '../../api'; import { GetNitroInstance } from '../../api';
export interface LayoutRoomPreviewerViewProps export interface LayoutRoomPreviewerViewProps
{ {
roomPreviewer: RoomPreviewer; roomPreviewer: RoomPreviewer;
height?: number; height?: number;
children?: ReactNode;
} }
export const LayoutRoomPreviewerView: FC<LayoutRoomPreviewerViewProps> = props => export const LayoutRoomPreviewerView: FC<LayoutRoomPreviewerViewProps> = props =>
{ {
const { roomPreviewer = null, height = 0 } = props; const { roomPreviewer = null, height = 0, children = null } = props;
const [ renderingCanvas, setRenderingCanvas ] = useState<IRoomRenderingCanvas>(null); const [ renderingCanvas, setRenderingCanvas ] = useState<IRoomRenderingCanvas>(null);
const elementRef = useRef<HTMLDivElement>(); const elementRef = useRef<HTMLDivElement>();
@ -98,7 +99,7 @@ export const LayoutRoomPreviewerView: FC<LayoutRoomPreviewerViewProps> = props =
return ( return (
<div className="room-preview-container"> <div className="room-preview-container">
<div ref={ elementRef } className="room-preview-image" style={ { height } } onClick={ onClick } /> <div ref={ elementRef } className="room-preview-image" style={ { height } } onClick={ onClick } />
{ props.children } { children }
</div> </div>
); );
} }

View File

@ -1,4 +1,4 @@
import { FC, useEffect, useState } from 'react'; import { FC, ReactNode, useEffect, useState } from 'react';
import { Transition } from 'react-transition-group'; import { Transition } from 'react-transition-group';
import { getTransitionAnimationStyle } from './TransitionAnimationStyles'; import { getTransitionAnimationStyle } from './TransitionAnimationStyles';
@ -8,6 +8,7 @@ interface TransitionAnimationProps
inProp: boolean; inProp: boolean;
timeout?: number; timeout?: number;
className?: string; className?: string;
children?: ReactNode;
} }
export const TransitionAnimation: FC<TransitionAnimationProps> = props => export const TransitionAnimation: FC<TransitionAnimationProps> = props =>

View File

@ -1,5 +1,5 @@
import { AchievementData } from '@nitrots/nitro-renderer'; import { AchievementData } from '@nitrots/nitro-renderer';
import { FC } from 'react'; import { FC, PropsWithChildren } from 'react';
import { GetAchievementBadgeCode, GetAchievementLevel, LocalizeBadgeDescription, LocalizeBadgeName, LocalizeText } from '../../../api'; import { GetAchievementBadgeCode, GetAchievementLevel, LocalizeBadgeDescription, LocalizeBadgeName, LocalizeText } from '../../../api';
import { Column, Flex, LayoutCurrencyIcon, LayoutProgressBar, Text } from '../../../common'; import { Column, Flex, LayoutCurrencyIcon, LayoutProgressBar, Text } from '../../../common';
import { AchievementBadgeView } from './AchievementBadgeView'; import { AchievementBadgeView } from './AchievementBadgeView';
@ -9,7 +9,7 @@ interface AchievementDetailsViewProps
achievement: AchievementData; achievement: AchievementData;
} }
export const AchievementDetailsView: FC<AchievementDetailsViewProps> = props => export const AchievementDetailsView: FC<PropsWithChildren<AchievementDetailsViewProps>> = props =>
{ {
const { achievement = null, children = null, ...rest } = props; const { achievement = null, children = null, ...rest } = props;

View File

@ -1,5 +1,5 @@
import { AchievementData } from '@nitrots/nitro-renderer'; import { AchievementData } from '@nitrots/nitro-renderer';
import { Dispatch, FC, SetStateAction } from 'react'; import { Dispatch, FC, PropsWithChildren, SetStateAction } from 'react';
import { LayoutGridItem } from '../../../../common'; import { LayoutGridItem } from '../../../../common';
import { AchievementBadgeView } from '../AchievementBadgeView'; import { AchievementBadgeView } from '../AchievementBadgeView';
@ -10,7 +10,7 @@ interface AchievementListItemViewProps
setSelectedAchievementId: Dispatch<SetStateAction<number>>; setSelectedAchievementId: Dispatch<SetStateAction<number>>;
} }
export const AchievementListItemView: FC<AchievementListItemViewProps> = props => export const AchievementListItemView: FC<PropsWithChildren<AchievementListItemViewProps>> = props =>
{ {
const { achievement = null, selectedAchievementId = -1, setSelectedAchievementId = null, children = null, ...rest } = props; const { achievement = null, selectedAchievementId = -1, setSelectedAchievementId = null, children = null, ...rest } = props;

View File

@ -1,5 +1,5 @@
import { AchievementData } from '@nitrots/nitro-renderer'; import { AchievementData } from '@nitrots/nitro-renderer';
import { Dispatch, FC, SetStateAction } from 'react'; import { Dispatch, FC, PropsWithChildren, SetStateAction } from 'react';
import { AutoGrid } from '../../../../common'; import { AutoGrid } from '../../../../common';
import { AchievementListItemView } from './AchievementListItemView'; import { AchievementListItemView } from './AchievementListItemView';
@ -10,7 +10,7 @@ interface AchievementListViewProps
setSelectedAchievementId: Dispatch<SetStateAction<number>>; setSelectedAchievementId: Dispatch<SetStateAction<number>>;
} }
export const AchievementListView: FC<AchievementListViewProps> = props => export const AchievementListView: FC<PropsWithChildren<AchievementListViewProps>> = props =>
{ {
const { achievements = null, selectedAchievementId = -1, setSelectedAchievementId = null, children = null, ...rest } = props; const { achievements = null, selectedAchievementId = -1, setSelectedAchievementId = null, children = null, ...rest } = props;

View File

@ -1,4 +1,4 @@
import { Dispatch, FC, SetStateAction } from 'react'; import { Dispatch, FC, PropsWithChildren, SetStateAction } from 'react';
import { GetAchievementCategoryImageUrl, GetAchievementCategoryMaxProgress, GetAchievementCategoryProgress, GetAchievementCategoryTotalUnseen, IAchievementCategory, LocalizeText } from '../../../../api'; import { GetAchievementCategoryImageUrl, GetAchievementCategoryMaxProgress, GetAchievementCategoryProgress, GetAchievementCategoryTotalUnseen, IAchievementCategory, LocalizeText } from '../../../../api';
import { LayoutBackgroundImage, LayoutGridItem, Text } from '../../../../common'; import { LayoutBackgroundImage, LayoutGridItem, Text } from '../../../../common';
@ -9,7 +9,7 @@ interface AchievementCategoryListItemViewProps
setSelectedCategoryCode: Dispatch<SetStateAction<string>>; setSelectedCategoryCode: Dispatch<SetStateAction<string>>;
} }
export const AchievementsCategoryListItemView: FC<AchievementCategoryListItemViewProps> = props => export const AchievementsCategoryListItemView: FC<PropsWithChildren<AchievementCategoryListItemViewProps>> = props =>
{ {
const { category = null, selectedCategoryCode = null, setSelectedCategoryCode = null, children = null, ...rest } = props; const { category = null, selectedCategoryCode = null, setSelectedCategoryCode = null, children = null, ...rest } = props;

View File

@ -1,4 +1,4 @@
import { Dispatch, FC, SetStateAction } from 'react'; import { Dispatch, FC, PropsWithChildren, SetStateAction } from 'react';
import { IAchievementCategory } from '../../../../api'; import { IAchievementCategory } from '../../../../api';
import { AutoGrid } from '../../../../common'; import { AutoGrid } from '../../../../common';
import { AchievementsCategoryListItemView } from './AchievementsCategoryListItemView'; import { AchievementsCategoryListItemView } from './AchievementsCategoryListItemView';
@ -10,7 +10,7 @@ interface AchievementsCategoryListViewProps
setSelectedCategoryCode: Dispatch<SetStateAction<string>>; setSelectedCategoryCode: Dispatch<SetStateAction<string>>;
} }
export const AchievementsCategoryListView: FC<AchievementsCategoryListViewProps> = props => export const AchievementsCategoryListView: FC<PropsWithChildren<AchievementsCategoryListViewProps>> = props =>
{ {
const { categories = null, selectedCategoryCode = null, setSelectedCategoryCode = null, children = null, ...rest } = props; const { categories = null, selectedCategoryCode = null, setSelectedCategoryCode = null, children = null, ...rest } = props;

View File

@ -1,9 +1,9 @@
import { FC } from 'react'; import { FC, PropsWithChildren } from 'react';
import { UnseenItemCategory } from '../../../../api'; import { UnseenItemCategory } from '../../../../api';
import { LayoutBadgeImageView, LayoutGridItem } from '../../../../common'; import { LayoutBadgeImageView, LayoutGridItem } from '../../../../common';
import { useInventoryBadges, useInventoryUnseenTracker } from '../../../../hooks'; import { useInventoryBadges, useInventoryUnseenTracker } from '../../../../hooks';
export const InventoryBadgeItemView: FC<{ badgeCode: string }> = props => export const InventoryBadgeItemView: FC<PropsWithChildren<{ badgeCode: string }>> = props =>
{ {
const { badgeCode = null, children = null, ...rest } = props; const { badgeCode = null, children = null, ...rest } = props;
const { selectedBadgeCode = null, setSelectedBadgeCode = null, getBadgeId = null } = useInventoryBadges(); const { selectedBadgeCode = null, setSelectedBadgeCode = null, getBadgeId = null } = useInventoryBadges();

View File

@ -1,10 +1,10 @@
import { MouseEventType } from '@nitrots/nitro-renderer'; import { MouseEventType } from '@nitrots/nitro-renderer';
import { FC, MouseEvent, useState } from 'react'; import { FC, MouseEvent, PropsWithChildren, useState } from 'react';
import { attemptBotPlacement, IBotItem, UnseenItemCategory } from '../../../../api'; import { attemptBotPlacement, IBotItem, UnseenItemCategory } from '../../../../api';
import { LayoutAvatarImageView, LayoutGridItem } from '../../../../common'; import { LayoutAvatarImageView, LayoutGridItem } from '../../../../common';
import { useInventoryBots, useInventoryUnseenTracker } from '../../../../hooks'; import { useInventoryBots, useInventoryUnseenTracker } from '../../../../hooks';
export const InventoryBotItemView: FC<{ botItem: IBotItem }> = props => export const InventoryBotItemView: FC<PropsWithChildren<{ botItem: IBotItem }>> = props =>
{ {
const { botItem = null, children = null, ...rest } = props; const { botItem = null, children = null, ...rest } = props;
const [ isMouseDown, setMouseDown ] = useState(false); const [ isMouseDown, setMouseDown ] = useState(false);

View File

@ -1,10 +1,10 @@
import { MouseEventType } from '@nitrots/nitro-renderer'; import { MouseEventType } from '@nitrots/nitro-renderer';
import { FC, MouseEvent, useState } from 'react'; import { FC, MouseEvent, PropsWithChildren, useState } from 'react';
import { attemptPetPlacement, IPetItem, UnseenItemCategory } from '../../../../api'; import { attemptPetPlacement, IPetItem, UnseenItemCategory } from '../../../../api';
import { LayoutGridItem, LayoutPetImageView } from '../../../../common'; import { LayoutGridItem, LayoutPetImageView } from '../../../../common';
import { useInventoryPets, useInventoryUnseenTracker } from '../../../../hooks'; import { useInventoryPets, useInventoryUnseenTracker } from '../../../../hooks';
export const InventoryPetItemView: FC<{ petItem: IPetItem }> = props => export const InventoryPetItemView: FC<PropsWithChildren<{ petItem: IPetItem }>> = props =>
{ {
const { petItem = null, children = null, ...rest } = props; const { petItem = null, children = null, ...rest } = props;
const [ isMouseDown, setMouseDown ] = useState(false); const [ isMouseDown, setMouseDown ] = useState(false);

View File

@ -1,5 +1,5 @@
import { MouseEventType, RoomObjectCategory } from '@nitrots/nitro-renderer'; import { MouseEventType, RoomObjectCategory } from '@nitrots/nitro-renderer';
import { Dispatch, FC, SetStateAction, useEffect, useRef } from 'react'; import { Dispatch, FC, PropsWithChildren, SetStateAction, useEffect, useRef } from 'react';
import { CreateLinkEvent, GetRoomEngine, GetRoomSession, GetSessionDataManager, GetUserProfile } from '../../api'; import { CreateLinkEvent, GetRoomEngine, GetRoomSession, GetSessionDataManager, GetUserProfile } from '../../api';
import { Base, Flex, LayoutItemCountView } from '../../common'; import { Base, Flex, LayoutItemCountView } from '../../common';
import { GuideToolEvent } from '../../events'; import { GuideToolEvent } from '../../events';
@ -12,7 +12,7 @@ interface ToolbarMeViewProps
setMeExpanded: Dispatch<SetStateAction<boolean>>; setMeExpanded: Dispatch<SetStateAction<boolean>>;
} }
export const ToolbarMeView: FC<ToolbarMeViewProps> = props => export const ToolbarMeView: FC<PropsWithChildren<ToolbarMeViewProps>> = props =>
{ {
const { useGuideTool = false, unseenAchievementCount = 0, setMeExpanded = null, children = null, ...rest } = props; const { useGuideTool = false, unseenAchievementCount = 0, setMeExpanded = null, children = null, ...rest } = props;
const elementRef = useRef<HTMLDivElement>(); const elementRef = useRef<HTMLDivElement>();

View File

@ -1,4 +1,4 @@
import { FC, useEffect, useState } from 'react'; import { FC, PropsWithChildren, useEffect, useState } from 'react';
import { GetSessionDataManager, LocalizeText, WiredFurniType, WiredSelectionVisualizer } from '../../../api'; import { GetSessionDataManager, LocalizeText, WiredFurniType, WiredSelectionVisualizer } from '../../../api';
import { Button, Column, Flex, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../common'; import { Button, Column, Flex, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../common';
import { useWiredContext } from '../WiredContext'; import { useWiredContext } from '../WiredContext';
@ -13,7 +13,7 @@ export interface WiredBaseViewProps
validate?: () => boolean; validate?: () => boolean;
} }
export const WiredBaseView: FC<WiredBaseViewProps> = props => export const WiredBaseView: FC<PropsWithChildren<WiredBaseViewProps>> = props =>
{ {
const { wiredType = '', requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, validate = null, children = null, hasSpecialInput = false } = props; const { wiredType = '', requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, validate = null, children = null, hasSpecialInput = false } = props;
const [ wiredName, setWiredName ] = useState<string>(null); const [ wiredName, setWiredName ] = useState<string>(null);

View File

@ -1,5 +1,5 @@
import { WiredActionDefinition } from '@nitrots/nitro-renderer'; import { WiredActionDefinition } from '@nitrots/nitro-renderer';
import { FC, useEffect } from 'react'; import { FC, PropsWithChildren, useEffect } from 'react';
import ReactSlider from 'react-slider'; import ReactSlider from 'react-slider';
import { GetWiredTimeLocale, LocalizeText, WiredFurniType } from '../../../../api'; import { GetWiredTimeLocale, LocalizeText, WiredFurniType } from '../../../../api';
import { Column, Text } from '../../../../common'; import { Column, Text } from '../../../../common';
@ -13,7 +13,7 @@ export interface WiredActionBaseViewProps
save: () => void; save: () => void;
} }
export const WiredActionBaseView: FC<WiredActionBaseViewProps> = props => export const WiredActionBaseView: FC<PropsWithChildren<WiredActionBaseViewProps>> = props =>
{ {
const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, hasSpecialInput = false, children = null } = props; const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, hasSpecialInput = false, children = null } = props;
const { trigger = null, actionDelay = 0, setActionDelay = null } = useWiredContext(); const { trigger = null, actionDelay = 0, setActionDelay = null } = useWiredContext();

View File

@ -1,4 +1,4 @@
import { FC } from 'react'; import { FC, PropsWithChildren } from 'react';
import { WiredFurniType } from '../../../../api'; import { WiredFurniType } from '../../../../api';
import { WiredBaseView } from '../WiredBaseView'; import { WiredBaseView } from '../WiredBaseView';
@ -9,7 +9,7 @@ export interface WiredConditionBaseViewProps
save: () => void; save: () => void;
} }
export const WiredConditionBaseView: FC<WiredConditionBaseViewProps> = props => export const WiredConditionBaseView: FC<PropsWithChildren<WiredConditionBaseViewProps>> = props =>
{ {
const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, hasSpecialInput = false, children = null } = props; const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, hasSpecialInput = false, children = null } = props;

View File

@ -1,4 +1,4 @@
import { FC } from 'react'; import { FC, PropsWithChildren } from 'react';
import { WiredFurniType } from '../../../../api'; import { WiredFurniType } from '../../../../api';
import { WiredBaseView } from '../WiredBaseView'; import { WiredBaseView } from '../WiredBaseView';
@ -9,7 +9,7 @@ export interface WiredTriggerBaseViewProps
save: () => void; save: () => void;
} }
export const WiredTriggerBaseView: FC<WiredTriggerBaseViewProps> = props => export const WiredTriggerBaseView: FC<PropsWithChildren<WiredTriggerBaseViewProps>> = props =>
{ {
const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, hasSpecialInput = false, children = null } = props; const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, hasSpecialInput = false, children = null } = props;

View File

@ -14,7 +14,7 @@
"strict": false, "strict": false,
"downlevelIteration": true, "downlevelIteration": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": false,
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "node",
"resolveJsonModule": true, "resolveJsonModule": true,

1026
yarn.lock

File diff suppressed because it is too large Load Diff