This commit is contained in:
Nathan Bierema 2025-12-01 08:39:59 -05:00
parent 51afe32a71
commit d734c9b43f
12 changed files with 50 additions and 31 deletions

View File

@ -13,8 +13,7 @@ const wrapperStyle = {
}; };
export interface Props<S, A extends Action<string>> export interface Props<S, A extends Action<string>>
extends LiftedState<S, A, ChartMonitorState>, extends LiftedState<S, A, ChartMonitorState>, Options {
Options {
dispatch: Dispatch<LiftedAction<S, A, ChartMonitorState>>; dispatch: Dispatch<LiftedAction<S, A, ChartMonitorState>>;
preserveScrollTop: boolean; preserveScrollTop: boolean;
select: (state: S) => unknown; select: (state: S) => unknown;

View File

@ -41,8 +41,7 @@ function invertColors(theme: Base16Theme) {
} }
export interface ChartMonitorProps<S, A extends Action<string>> export interface ChartMonitorProps<S, A extends Action<string>>
extends LiftedState<S, A, ChartMonitorState>, extends LiftedState<S, A, ChartMonitorState>, Options {
Options {
dispatch: Dispatch<LiftedAction<S, A, ChartMonitorState>>; dispatch: Dispatch<LiftedAction<S, A, ChartMonitorState>>;
preserveScrollTop: boolean; preserveScrollTop: boolean;
select: (state: S) => unknown; select: (state: S) => unknown;

View File

@ -44,8 +44,10 @@ interface DefaultProps {
fluid: boolean; fluid: boolean;
} }
export interface DockMonitorProps<S, A extends Action<string>> export interface DockMonitorProps<
extends LiftedState<S, A, DockMonitorState> { S,
A extends Action<string>,
> extends LiftedState<S, A, DockMonitorState> {
defaultPosition: 'left' | 'top' | 'right' | 'bottom'; defaultPosition: 'left' | 'top' | 'right' | 'bottom';
defaultIsVisible: boolean; defaultIsVisible: boolean;
defaultSize: number; defaultSize: number;

View File

@ -48,8 +48,10 @@ const styles: {
const ROOT = '/'; // process.env.NODE_ENV === 'production' ? '/' : '/'; const ROOT = '/'; // process.env.NODE_ENV === 'production' ? '/' : '/';
interface Props interface Props extends Omit<
extends Omit<DemoAppState, 'addFunction' | 'addSymbol' | 'shuffleArray'> { DemoAppState,
'addFunction' | 'addSymbol' | 'shuffleArray'
> {
toggleTimeoutUpdate: (timeoutUpdateEnabled: boolean) => void; toggleTimeoutUpdate: (timeoutUpdateEnabled: boolean) => void;
timeoutUpdate: () => void; timeoutUpdate: () => void;
increment: () => void; increment: () => void;

View File

@ -59,8 +59,10 @@ export function compare<S>(
).forEach(generate); ).forEach(generate);
} }
interface Props<S, A extends Action<string>> interface Props<S, A extends Action<string>> extends Omit<
extends Omit<TabComponentProps<S, A>, 'monitorState' | 'updateMonitorState'> { TabComponentProps<S, A>,
'monitorState' | 'updateMonitorState'
> {
name?: string; name?: string;
isVanilla?: boolean; isVanilla?: boolean;
wrap?: string | ((locals: WrapLocals) => string); wrap?: string | ((locals: WrapLocals) => string);

View File

@ -119,8 +119,10 @@ function buildUrl(options: Options) {
); );
} }
interface Props interface Props extends Omit<
extends Omit<DemoAppState, 'addFunction' | 'addSymbol' | 'shuffleArray'> { DemoAppState,
'addFunction' | 'addSymbol' | 'shuffleArray'
> {
toggleTimeoutUpdate: (timeoutUpdateEnabled: boolean) => void; toggleTimeoutUpdate: (timeoutUpdateEnabled: boolean) => void;
timeoutUpdate: () => void; timeoutUpdate: () => void;
increment: () => void; increment: () => void;

View File

@ -144,8 +144,10 @@ interface DefaultProps {
invertTheme: boolean; invertTheme: boolean;
} }
export interface DevtoolsInspectorProps<S, A extends Action<string>> export interface DevtoolsInspectorProps<
extends LiftedState<S, A, DevtoolsInspectorState> { S,
A extends Action<string>,
> extends LiftedState<S, A, DevtoolsInspectorState> {
dispatch: Dispatch< dispatch: Dispatch<
DevtoolsInspectorAction | LiftedAction<S, A, DevtoolsInspectorState> DevtoolsInspectorAction | LiftedAction<S, A, DevtoolsInspectorState>
>; >;

View File

@ -64,8 +64,10 @@ interface DefaultProps<S> {
markStateDiff: boolean; markStateDiff: boolean;
} }
export interface LogMonitorProps<S, A extends Action<string>> export interface LogMonitorProps<
extends LiftedState<S, A, LogMonitorState> { S,
A extends Action<string>,
> extends LiftedState<S, A, LogMonitorState> {
dispatch: Dispatch<LogMonitorAction | LiftedAction<S, A, LogMonitorState>>; dispatch: Dispatch<LogMonitorAction | LiftedAction<S, A, LogMonitorState>>;
preserveScrollTop: boolean; preserveScrollTop: boolean;

View File

@ -6,8 +6,7 @@ import { getJsonTreeTheme, StyleUtilsContext } from '../styles/themes';
import { getItemString, labelRenderer } from '../styles/tree'; import { getItemString, labelRenderer } from '../styles/tree';
import { identity } from '../utils/object'; import { identity } from '../utils/object';
export interface TreeViewProps export interface TreeViewProps extends Partial<
extends Partial<
Pick< Pick<
ComponentProps<typeof JSONTree>, ComponentProps<typeof JSONTree>,
'keyPath' | 'shouldExpandNodeInitially' | 'hideRoot' 'keyPath' | 'shouldExpandNodeInitially' | 'hideRoot'

View File

@ -23,8 +23,10 @@ type ForwardedMonitorProps<S, A extends Action<string>> = Pick<
'monitorState' | 'currentStateIndex' | 'computedStates' | 'actionsById' 'monitorState' | 'currentStateIndex' | 'computedStates' | 'actionsById'
>; >;
export interface RtkQueryInspectorProps<S, A extends Action<string>> export interface RtkQueryInspectorProps<
extends ForwardedMonitorProps<S, A> { S,
A extends Action<string>,
> extends ForwardedMonitorProps<S, A> {
dispatch: Dispatch<LiftedAction<S, A, RtkQueryMonitorState>>; dispatch: Dispatch<LiftedAction<S, A, RtkQueryMonitorState>>;
} }

View File

@ -35,8 +35,10 @@ export interface RtkQueryMonitorState {
readonly selectedPreviewTab: QueryPreviewTabs; readonly selectedPreviewTab: QueryPreviewTabs;
} }
export interface RtkQueryMonitorProps<S, A extends Action<string>> export interface RtkQueryMonitorProps<
extends LiftedState<S, A, RtkQueryMonitorState> { S,
A extends Action<string>,
> extends LiftedState<S, A, RtkQueryMonitorState> {
dispatch: Dispatch<Action | LiftedAction<S, A, RtkQueryMonitorState>>; dispatch: Dispatch<Action | LiftedAction<S, A, RtkQueryMonitorState>>;
theme: keyof typeof base16Themes | Base16Theme; theme: keyof typeof base16Themes | Base16Theme;
invertTheme: boolean; invertTheme: boolean;
@ -187,8 +189,11 @@ export interface ApiStats {
}>; }>;
} }
export interface TabOption<S, P, V extends string = 'default'> export interface TabOption<
extends SelectOption<S, V> { S,
P,
V extends string = 'default',
> extends SelectOption<S, V> {
component: ComponentType<P>; component: ComponentType<P>;
} }

View File

@ -47,8 +47,11 @@ export type Monitor<
} }
>; >;
export interface DevToolsInstance<S, A extends Action<string>, MonitorState> export interface DevToolsInstance<
extends Component<Props<S, A, MonitorState>> { S,
A extends Action<string>,
MonitorState,
> extends Component<Props<S, A, MonitorState>> {
liftedStore?: LiftedStore<S, A, MonitorState>; liftedStore?: LiftedStore<S, A, MonitorState>;
} }