Update prop types

This commit is contained in:
Nathan Bierema 2023-01-02 11:44:12 -05:00
parent 6f6ae1ddac
commit 1320e7a315
2 changed files with 6 additions and 42 deletions

View File

@ -1,6 +1,6 @@
import React, { Component, createRef } from 'react';
import { tree } from 'd3-state-visualizer';
import type { HierarchyPointNode, Node, StyleValue } from 'd3-state-visualizer';
import type { Options } from 'd3-state-visualizer';
import { Action, Dispatch } from 'redux';
import { LiftedAction, LiftedState } from '@redux-devtools/core';
import * as themes from 'redux-devtools-themes';
@ -12,7 +12,8 @@ const wrapperStyle = {
};
export interface Props<S, A extends Action<unknown>>
extends LiftedState<S, A, ChartMonitorState> {
extends LiftedState<S, A, ChartMonitorState>,
Options {
dispatch: Dispatch<LiftedAction<S, A, ChartMonitorState>>;
preserveScrollTop: boolean;
select: (state: S) => unknown;
@ -20,20 +21,6 @@ export interface Props<S, A extends Action<unknown>>
invertTheme: boolean;
state: S | null;
isSorted: boolean;
heightBetweenNodesCoeff: number;
widthBetweenNodesCoeff: number;
onClickText: (datum: HierarchyPointNode<Node>) => void;
tooltipOptions: {
disabled: boolean;
offset: {
left: number;
top: number;
};
indentationSize: number;
styles: { [key: string]: StyleValue } | undefined;
};
chartStyles: { [key: string]: StyleValue } | undefined;
defaultIsVisible?: boolean;
}

View File

@ -7,7 +7,7 @@ import {
} from '@redux-devtools/core';
import deepmerge from 'deepmerge';
import { Action, Dispatch } from 'redux';
import type { HierarchyPointNode, Node } from 'd3-state-visualizer';
import type { Options } from 'd3-state-visualizer';
import reducer, { ChartMonitorState } from './reducers';
import Chart, { Props } from './Chart';
@ -40,37 +40,14 @@ function invertColors(theme: themes.Base16Theme) {
}
export interface ChartMonitorProps<S, A extends Action<unknown>>
extends LiftedState<S, A, ChartMonitorState> {
extends LiftedState<S, A, ChartMonitorState>,
Options {
dispatch: Dispatch<LiftedAction<S, A, ChartMonitorState>>;
preserveScrollTop: boolean;
select: (state: S) => unknown;
theme: keyof typeof themes | themes.Base16Theme;
invertTheme: boolean;
state: S | null;
isSorted: boolean;
heightBetweenNodesCoeff: number;
widthBetweenNodesCoeff: number;
onClickText: (datum: HierarchyPointNode<Node>) => void;
tooltipOptions: unknown;
style: {
width: number;
height: number;
node: {
colors: {
default: string;
collapsed: string;
parent: string;
};
radius: number;
};
text: {
colors: {
default: string;
hover: string;
};
};
};
defaultIsVisible?: boolean;
}