Explicitly define return type

This commit is contained in:
Nathan Bierema 2023-12-16 11:42:59 -05:00
parent 1a2fef9f27
commit 0d877113c9
5 changed files with 10 additions and 5 deletions

View File

@ -18,6 +18,7 @@ import {
verticalListSortingStrategy, verticalListSortingStrategy,
} from '@dnd-kit/sortable'; } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities'; import { CSS } from '@dnd-kit/utilities';
import type { JSX } from '@emotion/react/jsx-runtime';
import ActionListRow from './ActionListRow'; import ActionListRow from './ActionListRow';
import ActionListHeader from './ActionListHeader'; import ActionListHeader from './ActionListHeader';
@ -80,7 +81,7 @@ export default function ActionList<A extends Action<string>>({
onJumpToState, onJumpToState,
lastActionId, lastActionId,
onReorderAction, onReorderAction,
}: Props<A>) { }: Props<A>): JSX.Element {
const nodeRef = useRef<HTMLDivElement | null>(null); const nodeRef = useRef<HTMLDivElement | null>(null);
const prevLastActionId = useRef<number | undefined>(); const prevLastActionId = useRef<number | undefined>();

View File

@ -4,6 +4,7 @@ import type { DebouncedFunc } from 'lodash';
import debounce from 'lodash.debounce'; import debounce from 'lodash.debounce';
import { Action } from 'redux'; import { Action } from 'redux';
import type { Interpolation, Theme } from '@emotion/react'; import type { Interpolation, Theme } from '@emotion/react';
import type { JSX } from '@emotion/react/jsx-runtime';
import RightSlider from './RightSlider'; import RightSlider from './RightSlider';
import { import {
selectorButtonCss, selectorButtonCss,
@ -52,7 +53,7 @@ export default class ActionListRow<
> extends PureComponent<Props<A>, State> { > extends PureComponent<Props<A>, State> {
state: State = { hover: false }; state: State = { hover: false };
render() { render(): JSX.Element {
const { const {
isSelected, isSelected,
action, action,

View File

@ -4,6 +4,7 @@ import { Action } from 'redux';
import type { LabelRenderer } from 'react-json-tree'; import type { LabelRenderer } from 'react-json-tree';
import { PerformAction } from '@redux-devtools/core'; import { PerformAction } from '@redux-devtools/core';
import { Delta } from 'jsondiffpatch'; import { Delta } from 'jsondiffpatch';
import type { JSX } from '@emotion/react/jsx-runtime';
import { DEFAULT_STATE, DevtoolsInspectorState } from './redux'; import { DEFAULT_STATE, DevtoolsInspectorState } from './redux';
import ActionPreviewHeader from './ActionPreviewHeader'; import ActionPreviewHeader from './ActionPreviewHeader';
import DiffTab from './tabs/DiffTab'; import DiffTab from './tabs/DiffTab';
@ -80,7 +81,7 @@ class ActionPreview<S, A extends Action<string>> extends Component<
tabName: DEFAULT_STATE.tabName, tabName: DEFAULT_STATE.tabName,
}; };
render() { render(): JSX.Element {
const { const {
delta, delta,
error, error,

View File

@ -6,6 +6,7 @@ import { Delta } from 'jsondiffpatch';
import { Base16Theme } from 'redux-devtools-themes'; import { Base16Theme } from 'redux-devtools-themes';
import { css } from '@emotion/react'; import { css } from '@emotion/react';
import type { Interpolation, Theme } from '@emotion/react'; import type { Interpolation, Theme } from '@emotion/react';
import type { JSX } from '@emotion/react/jsx-runtime';
import getItemString from './getItemString'; import getItemString from './getItemString';
import getJsonTreeTheme from './getJsonTreeTheme'; import getJsonTreeTheme from './getJsonTreeTheme';
@ -91,7 +92,7 @@ export default class JSONDiff extends Component<Props, State> {
this.setState({ data: this.props.delta }); this.setState({ data: this.props.delta });
} }
render() { render(): JSX.Element {
const { base16Theme, ...props } = this.props; const { base16Theme, ...props } = this.props;
if (!this.state.data) { if (!this.state.data) {

View File

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { isCollection, isIndexed, isKeyed } from 'immutable'; import { isCollection, isIndexed, isKeyed } from 'immutable';
import type { JSX } from '@emotion/react/jsx-runtime';
import isIterable from '../utils/isIterable'; import isIterable from '../utils/isIterable';
const IS_IMMUTABLE_KEY = '@@__IS_IMMUTABLE__@@'; const IS_IMMUTABLE_KEY = '@@__IS_IMMUTABLE__@@';
@ -76,7 +77,7 @@ const getItemString = (
dataTypeKey: string | symbol | undefined, dataTypeKey: string | symbol | undefined,
isWideLayout: boolean, isWideLayout: boolean,
isDiff?: boolean, isDiff?: boolean,
) => ( ): JSX.Element => (
<span css={(theme) => ({ color: theme.ITEM_HINT_COLOR })}> <span css={(theme) => ({ color: theme.ITEM_HINT_COLOR })}>
{data[IS_IMMUTABLE_KEY] ? 'Immutable' : ''} {data[IS_IMMUTABLE_KEY] ? 'Immutable' : ''}
{dataTypeKey && data[dataTypeKey] ? `${data[dataTypeKey] as string} ` : ''} {dataTypeKey && data[dataTypeKey] ? `${data[dataTypeKey] as string} ` : ''}