This commit is contained in:
Nathan Bierema 2020-05-21 23:33:35 -05:00
parent 1a5adffe26
commit b8aa3c20cd
5 changed files with 16 additions and 28 deletions

View File

@ -8,14 +8,6 @@ module.exports = {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json']
}
},
{
files: ['test/*.ts', 'test/*.tsx'],
extends: '../../eslintrc.ts.react.jest.base.json',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./test/tsconfig.json']
}
}
]
};

View File

@ -16,7 +16,7 @@
"build:types": "tsc --emitDeclarationOnly",
"build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tx --fix",
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
"prepare": "npm run build",
"prepublishOnly": "npm run test && npm run clean && npm run build"
},
@ -45,19 +45,21 @@
"@babel/plugin-proposal-class-properties": "^7.3.0",
"@babel/preset-env": "^7.3.1",
"@babel/preset-react": "^7.0.0",
"@types/react": "^15.0.0 || ^16.0.0",
"@types/lodash.debounce": "^4.0.4",
"@typescript-eslint/eslint-plugin": "^2.31.0",
"@typescript-eslint/parser": "^2.31.0",
"babel-loader": "^8.0.5",
"react": "^15.0.0 || ^16.0.0",
"redux-devtools": "^3.4.0",
"rimraf": "^2.3.4"
"rimraf": "^2.3.4",
"typescript": "^3.8.3"
},
"peerDependencies": {
"@types/react": "^15.0.0 || ^16.0.0",
"react": "^15.0.0 || ^16.0.0",
"@types/react": "^16.3.0",
"react": "^16.3.0",
"redux-devtools": "^3.4.0"
},
"dependencies": {
"@types/lodash.debounce": "^4.0.4",
"@types/prop-types": "^15.0.0",
"lodash.debounce": "^4.0.4",
"prop-types": "^15.0.0",

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import shouldPureComponentUpdate from 'react-pure-render/function';
import * as themes from 'redux-devtools-themes';
import { ActionCreators, LiftedAction, PerformAction } from 'redux-devtools';
import { ActionCreators, LiftedAction, LiftedState } from 'redux-devtools';
import { Base16Theme } from 'base16';
import { Action, Dispatch } from 'redux';
import {
@ -41,16 +41,11 @@ const styles: {
}
};
export interface Props<S, A extends Action> {
export interface Props<S, A extends Action<unknown>>
extends LiftedState<S, A, LogMonitorState> {
dispatch: Dispatch<
LogMonitorAction | LiftedAction<S, A, LogMonitorState, LogMonitorAction>
>;
computedStates: { state: S; error?: string }[];
actionsById: { [actionId: number]: PerformAction<A> };
stagedActionIds: number[];
skippedActionIds: number[];
currentStateIndex: number;
monitorState: LogMonitorState;
preserveScrollTop: boolean;
select: (state: S) => unknown;

View File

@ -2,7 +2,6 @@ import React, { Component, MouseEventHandler } from 'react';
import PropTypes from 'prop-types';
import JSONTree from 'react-json-tree';
import { Base16Theme } from 'base16';
import { Action } from 'redux';
import LogMonitorEntryAction from './LogMonitorEntryAction';
import shouldPureComponentUpdate from 'react-pure-render/function';
import { Styling, StylingConfig, StylingValue } from 'react-base16-styling';

View File

@ -27,16 +27,16 @@ function startConsecutiveToggle<S, A extends Action>(
}
interface InitialLogMonitorState {
initialScrollTop?: number;
consecutiveToggleStartId?: number | null;
readonly initialScrollTop?: number;
readonly consecutiveToggleStartId?: number | null;
}
export interface LogMonitorState {
initialScrollTop: number;
consecutiveToggleStartId?: number | null;
readonly initialScrollTop: number;
readonly consecutiveToggleStartId?: number | null;
}
export default function reducer<S, A extends Action>(
export default function reducer<S, A extends Action<unknown>>(
props: Props<S, A>,
state: InitialLogMonitorState = {},
action: LogMonitorAction