feat(redux-devtools-slider-monitor): convert to TypeScript (#631)

* start

* fix?

* fix lint
This commit is contained in:
Nathan Bierema 2020-09-10 10:10:53 -04:00 committed by GitHub
parent 727d753081
commit 89917320e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 175 additions and 82 deletions

View File

@ -1,9 +1,9 @@
import React, { Component, ReactNode } from 'react'; import React, { Component, ReactNode } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Base16Theme } from 'base16';
import createStyledComponent from '../utils/createStyledComponent'; import createStyledComponent from '../utils/createStyledComponent';
import * as styles from './styles'; import * as styles from './styles';
import { commonStyle, tooltipStyle } from './styles/common'; import { commonStyle, tooltipStyle } from './styles/common';
import { Theme } from '../themes/default';
const ButtonWrapper = createStyledComponent(styles, 'button'); const ButtonWrapper = createStyledComponent(styles, 'button');
const TooltipWrapper = createStyledComponent(tooltipStyle); const TooltipWrapper = createStyledComponent(tooltipStyle);
@ -41,7 +41,7 @@ export interface ButtonProps {
primary?: boolean; primary?: boolean;
size?: Size; size?: Size;
mark?: Mark | false; mark?: Mark | false;
theme?: Theme; theme?: Base16Theme;
} }
export default class Button extends Component<ButtonProps> { export default class Button extends Component<ButtonProps> {

View File

@ -1,10 +1,10 @@
import React, { PureComponent, Component } from 'react'; import React, { PureComponent, Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Base16Theme } from 'base16';
import createStyledComponent from '../utils/createStyledComponent'; import createStyledComponent from '../utils/createStyledComponent';
import * as styles from './styles'; import * as styles from './styles';
import Button from '../Button'; import Button from '../Button';
import Form from '../Form'; import Form from '../Form';
import { Theme } from '../themes/default';
import { Props as FormProps } from '../Form/Form'; import { Props as FormProps } from '../Form/Form';
const DialogWrapper = createStyledComponent(styles); const DialogWrapper = createStyledComponent(styles);
@ -23,7 +23,7 @@ export interface DialogProps {
e: React.MouseEvent<HTMLButtonElement | HTMLDivElement> | false e: React.MouseEvent<HTMLButtonElement | HTMLDivElement> | false
) => void; ) => void;
onSubmit: () => void; onSubmit: () => void;
theme?: Theme; theme?: Base16Theme;
} }
type Rest<P> = Omit< type Rest<P> = Omit<

View File

@ -2,6 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import styled from 'styled-components'; import styled from 'styled-components';
import CodeMirror from 'codemirror'; import CodeMirror from 'codemirror';
import { Base16Theme } from 'base16';
import { defaultStyle, themedStyle } from './styles'; import { defaultStyle, themedStyle } from './styles';
import { Theme } from '../themes/default'; import { Theme } from '../themes/default';
@ -19,7 +20,7 @@ export interface EditorProps {
lineNumbers: boolean; lineNumbers: boolean;
lineWrapping: boolean; lineWrapping: boolean;
readOnly: boolean; readOnly: boolean;
theme?: Theme; theme?: Base16Theme;
foldGutter: boolean; foldGutter: boolean;
autofocus: boolean; autofocus: boolean;
onChange: (value: string, change: CodeMirror.EditorChangeLinkedList) => void; onChange: (value: string, change: CodeMirror.EditorChangeLinkedList) => void;

View File

@ -1,11 +1,11 @@
import React, { PureComponent, Component } from 'react'; import React, { PureComponent, Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import JSONSchemaForm, { FormProps } from 'react-jsonschema-form'; import JSONSchemaForm, { FormProps } from 'react-jsonschema-form';
import { Base16Theme } from 'base16';
import createStyledComponent from '../utils/createStyledComponent'; import createStyledComponent from '../utils/createStyledComponent';
import styles from './styles'; import styles from './styles';
import Button from '../Button'; import Button from '../Button';
import customWidgets from './widgets'; import customWidgets from './widgets';
import { Theme } from '../themes/default';
const FormContainer = createStyledComponent(styles, JSONSchemaForm); const FormContainer = createStyledComponent(styles, JSONSchemaForm);
@ -14,7 +14,7 @@ export interface Props<T> extends FormProps<T> {
submitText?: string; submitText?: string;
primaryButton?: boolean; primaryButton?: boolean;
noSubmit?: boolean; noSubmit?: boolean;
theme?: Theme; theme?: Base16Theme;
} }
/** /**

View File

@ -4,9 +4,9 @@ import { MdClose } from 'react-icons/md';
import { MdWarning } from 'react-icons/md'; import { MdWarning } from 'react-icons/md';
import { MdError } from 'react-icons/md'; import { MdError } from 'react-icons/md';
import { MdCheckCircle } from 'react-icons/md'; import { MdCheckCircle } from 'react-icons/md';
import { Base16Theme } from 'base16';
import createStyledComponent from '../utils/createStyledComponent'; import createStyledComponent from '../utils/createStyledComponent';
import styles from './styles'; import styles from './styles';
import { Theme } from '../themes/default';
const NotificationWrapper = createStyledComponent(styles); const NotificationWrapper = createStyledComponent(styles);
@ -16,7 +16,7 @@ export interface NotificationProps {
children?: React.ReactNode; children?: React.ReactNode;
type: Type; type: Type;
onClose?: React.MouseEventHandler<HTMLButtonElement>; onClose?: React.MouseEventHandler<HTMLButtonElement>;
theme?: Theme; theme?: Base16Theme;
} }
export default class Notification extends Component<NotificationProps> { export default class Notification extends Component<NotificationProps> {

View File

@ -1,8 +1,8 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Base16Theme } from 'base16';
import createStyledComponent from '../utils/createStyledComponent'; import createStyledComponent from '../utils/createStyledComponent';
import styles from './styles'; import styles from './styles';
import { Theme } from '../themes/default';
const SegmentedWrapper = createStyledComponent(styles); const SegmentedWrapper = createStyledComponent(styles);
@ -11,7 +11,7 @@ export interface SegmentedControlProps {
selected?: string; selected?: string;
onClick: (value: string) => void; onClick: (value: string) => void;
disabled?: boolean; disabled?: boolean;
theme?: Theme; theme?: Base16Theme;
} }
export default class SegmentedControl extends Component<SegmentedControlProps> { export default class SegmentedControl extends Component<SegmentedControlProps> {

View File

@ -1,9 +1,9 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Base16Theme } from 'base16';
import createStyledComponent from '../utils/createStyledComponent'; import createStyledComponent from '../utils/createStyledComponent';
import * as styles from './styles'; import * as styles from './styles';
import { containerStyle } from './styles/common'; import { containerStyle } from './styles/common';
import { Theme } from '../themes/default';
const SliderWrapper = createStyledComponent(styles); const SliderWrapper = createStyledComponent(styles);
const ContainerWithValue = createStyledComponent(containerStyle); const ContainerWithValue = createStyledComponent(containerStyle);
@ -17,7 +17,7 @@ export interface SliderProps {
withValue?: boolean; withValue?: boolean;
disabled?: boolean; disabled?: boolean;
onChange: (value: number) => void; onChange: (value: number) => void;
theme?: Theme; theme?: Base16Theme;
} }
export default class Slider extends Component<SliderProps> { export default class Slider extends Component<SliderProps> {

View File

@ -1,5 +1,6 @@
import styled, { ThemedStyledInterface } from 'styled-components'; import styled, { ThemedStyledInterface } from 'styled-components';
import { Theme } from '../../themes/default'; import { Base16Theme } from 'base16';
import * as CSS from 'csstype';
export type BorderPosition = 'top' | 'bottom'; export type BorderPosition = 'top' | 'bottom';
@ -10,7 +11,9 @@ export interface Props {
noBorder?: boolean; noBorder?: boolean;
} }
const Toolbar = (styled as ThemedStyledInterface<Theme>).div<Props>` const Toolbar = (styled as ThemedStyledInterface<
Base16Theme & { fontFamily?: CSS.Property.FontFamily }
>).div<Props>`
display: flex; display: flex;
flex-shrink: 0; flex-shrink: 0;
box-sizing: border-box; box-sizing: border-box;

View File

@ -59,7 +59,10 @@ export default function createStyledComponent<
C extends keyof JSX.IntrinsicElements | React.ComponentType<any>, C extends keyof JSX.IntrinsicElements | React.ComponentType<any>,
// eslint-disable-next-line @typescript-eslint/ban-types // eslint-disable-next-line @typescript-eslint/ban-types
O extends object = {} O extends object = {}
>(styles: Styles<C, O>, component?: C): StyledComponent<C, Theme, O> { >(
styles: Styles<C, O>,
component?: C
): StyledComponent<C, Theme | Base16Theme, O> {
return (styled as ThemedStyledInterface<Theme>)((component || 'div') as C)` return (styled as ThemedStyledInterface<Theme>)((component || 'div') as C)`
${(props: ThemedStyledProps<StyledComponentPropsWithRef<C> & O, Theme>) => ${(props: ThemedStyledProps<StyledComponentPropsWithRef<C> & O, Theme>) =>
isThemeFromProvider(props.theme) isThemeFromProvider(props.theme)
@ -72,7 +75,7 @@ export default function createStyledComponent<
...props, ...props,
theme: getDefaultTheme(props.theme), theme: getDefaultTheme(props.theme),
})} })}
`; ` as StyledComponent<C, Theme | Base16Theme, O>;
} }
// TODO: memoize it? // TODO: memoize it?

View File

@ -57,7 +57,7 @@
"peerDependencies": { "peerDependencies": {
"@types/react": "^16.9.46", "@types/react": "^16.9.46",
"react": "^16.3.0", "react": "^16.3.0",
"redux": "^4.0.5", "redux": "^3.4.0 || ^4.0.0",
"redux-devtools": "^3.4.0" "redux-devtools": "^3.4.0"
} }
} }

View File

@ -1,4 +1,8 @@
{ {
"presets": ["@babel/preset-env", "@babel/preset-react"], "presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": ["@babel/plugin-proposal-class-properties"] "plugins": ["@babel/plugin-proposal-class-properties"]
} }

View File

@ -0,0 +1,2 @@
examples
lib

View File

@ -0,0 +1,13 @@
module.exports = {
extends: '../../.eslintrc',
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: '../../eslintrc.ts.react.base.json',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
},
],
};

View File

@ -13,19 +13,17 @@
"url": "https://github.com/calesce/redux-slider-monitor.git" "url": "https://github.com/calesce/redux-slider-monitor.git"
}, },
"license": "MIT", "license": "MIT",
"devDependencies": {
"@babel/core": "^7.11.0",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-react": "^7.10.4",
"babel-loader": "^8.1.0",
"raw-loader": "^4.0.1",
"webpack": "^4.44.1",
"webpack-dev-server": "^3.11.0"
},
"dependencies": { "dependencies": {
"classnames": "^2.2.6",
"react-hot-loader": "^4.12.21", "react-hot-loader": "^4.12.21",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.1", "react-redux": "^7.2.1",
"redux-devtools-slider-monitor": "^2.0.0-5" "redux": "^4.0.5",
"redux-devtools": "^3.7.0",
"redux-devtools-dock-monitor": "^1.2.0",
"redux-devtools-log-monitor": "^2.1.0",
"redux-devtools-slider-monitor": "^2.0.0-5",
"todomvc-app-css": "^2.3.0"
} }
} }

View File

@ -2,47 +2,51 @@
"name": "redux-devtools-slider-monitor", "name": "redux-devtools-slider-monitor",
"version": "2.0.0-5", "version": "2.0.0-5",
"description": "A custom monitor for replaying Redux actions that works similarly to a video player", "description": "A custom monitor for replaying Redux actions that works similarly to a video player",
"main": "lib/SliderMonitor.js", "homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/redux-devtools-slider-monitor",
"scripts": {
"clean": "rimraf lib",
"build": "babel src --out-dir lib",
"prepare": "npm run build",
"prepublishOnly": "npm run clean && npm run build"
},
"repository": {
"url": "https://github.com/reduxjs/redux-devtools"
},
"author": "Cale Newman <newman.cale@gmail.com> (http://github.com/calesce)",
"license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/reduxjs/redux-devtools/issues" "url": "https://github.com/reduxjs/redux-devtools/issues"
}, },
"homepage": "https://github.com/reduxjs/redux-devtools", "license": "MIT",
"devDependencies": { "author": "Cale Newman <newman.cale@gmail.com> (http://github.com/calesce)",
"@babel/cli": "^7.10.5", "files": [
"@babel/core": "^7.11.1", "lib",
"@babel/plugin-proposal-class-properties": "^7.10.4", "src"
"@babel/preset-env": "^7.11.0", ],
"@babel/preset-react": "^7.10.4", "main": "lib/SliderMonitor.js",
"classnames": "^2.2.6", "types": "lib/SliderMonitor.d.ts",
"react": "^16.13.1", "repository": {
"react-dom": "^16.13.1", "type": "git",
"redux": "^4.0.5", "url": "https://github.com/reduxjs/redux-devtools.git"
"redux-devtools": "^3.7.0",
"redux-devtools-dock-monitor": "^1.2.0",
"redux-devtools-log-monitor": "^2.1.0",
"rimraf": "^3.0.2",
"style-loader": "^1.2.1",
"todomvc-app-css": "^2.3.0"
}, },
"peerDependencies": { "scripts": {
"react": "^0.14.0 || ^15.0.0 || ^16.0.0-0", "build": "npm run build:types && npm run build:js",
"react-dom": "^0.14.0 || ^15.0.0 || ^16.0.0-0", "build:types": "tsc --emitDeclarationOnly",
"redux-devtools": "^3.0.0" "build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline",
"clean": "rimraf lib",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"type-check": "tsc --noEmit",
"type-check:watch": "npm run type-check -- --watch",
"preversion": "npm run type-check && npm run lint",
"prepublishOnly": "npm run clean && npm run build"
}, },
"dependencies": { "dependencies": {
"@types/prop-types": "^15.7.3",
"@types/redux-devtools-themes": "^1.0.0",
"devui": "^1.0.0-6", "devui": "^1.0.0-6",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"redux-devtools-themes": "^1.0.0" "redux-devtools-themes": "^1.0.0"
},
"devDependencies": {
"@types/react": "^16.9.46",
"react": "^16.13.1",
"redux": "^4.0.5",
"redux-devtools": "^3.7.0"
},
"peerDependencies": {
"@types/react": "^16.3.18",
"react": "^16.3.0",
"redux": "^3.4.0 || ^4.0.0",
"redux-devtools": "^3.4.0"
} }
} }

View File

@ -1,8 +1,16 @@
import React, { Component, PureComponent } from 'react'; import React, { Component, PureComponent } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Base16Theme } from 'redux-devtools-themes';
import Button from 'devui/lib/Button'; import Button from 'devui/lib/Button';
export default class SliderButton extends (PureComponent || Component) { interface Props {
theme: Base16Theme;
type: string;
onClick: () => void;
disabled?: boolean;
}
export default class SliderButton extends (PureComponent || Component)<Props> {
static propTypes = { static propTypes = {
theme: PropTypes.object, theme: PropTypes.object,
type: PropTypes.string, type: PropTypes.string,
@ -61,7 +69,7 @@ export default class SliderButton extends (PureComponent || Component) {
</Button> </Button>
); );
renderStepButton = (direction) => { renderStepButton = (direction: 'left' | 'right') => {
const isLeft = direction === 'left'; const isLeft = direction === 'left';
const d = isLeft const d = isLeft
? 'M15.41 16.09l-4.58-4.59 4.58-4.59-1.41-1.41-6 6 6 6z' ? 'M15.41 16.09l-4.58-4.59 4.58-4.59-1.41-1.41-6 6 6 6z'

View File

@ -1,7 +1,9 @@
import React, { Component, PureComponent } from 'react'; import React, { Component, PureComponent } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Action, Dispatch } from 'redux';
import * as themes from 'redux-devtools-themes'; import * as themes from 'redux-devtools-themes';
import { ActionCreators } from 'redux-devtools'; import { Base16Theme } from 'redux-devtools-themes';
import { ActionCreators, LiftedAction, LiftedState } from 'redux-devtools';
import { Toolbar, Divider } from 'devui/lib/Toolbar'; import { Toolbar, Divider } from 'devui/lib/Toolbar';
import Slider from 'devui/lib/Slider'; import Slider from 'devui/lib/Slider';
import Button from 'devui/lib/Button'; import Button from 'devui/lib/Button';
@ -10,9 +12,44 @@ import SegmentedControl from 'devui/lib/SegmentedControl';
import reducer from './reducers'; import reducer from './reducers';
import SliderButton from './SliderButton'; import SliderButton from './SliderButton';
// eslint-disable-next-line @typescript-eslint/unbound-method
const { reset, jumpToState } = ActionCreators; const { reset, jumpToState } = ActionCreators;
export default class SliderMonitor extends (PureComponent || Component) { interface ExternalProps<S, A extends Action<unknown>> {
// eslint-disable-next-line @typescript-eslint/ban-types
dispatch: Dispatch<LiftedAction<S, A, {}>>;
preserveScrollTop: boolean;
select: (state: S) => unknown;
theme: keyof typeof themes | Base16Theme;
keyboardEnabled: boolean;
hideResetButton?: boolean;
}
interface DefaultProps {
select: (state: unknown) => unknown;
theme: keyof typeof themes;
preserveScrollTop: boolean;
keyboardEnabled: boolean;
}
interface SliderMonitorProps<S, A extends Action<unknown>> // eslint-disable-next-line @typescript-eslint/ban-types
extends LiftedState<S, A, {}> {
// eslint-disable-next-line @typescript-eslint/ban-types
dispatch: Dispatch<LiftedAction<S, A, {}>>;
preserveScrollTop: boolean;
select: (state: S) => unknown;
theme: keyof typeof themes | Base16Theme;
keyboardEnabled: boolean;
hideResetButton?: boolean;
}
interface State {
timer: number | undefined;
replaySpeed: string;
}
class SliderMonitor<S, A extends Action<unknown>> extends (PureComponent ||
Component)<SliderMonitorProps<S, A>, State> {
static update = reducer; static update = reducer;
static propTypes = { static propTypes = {
@ -25,7 +62,7 @@ export default class SliderMonitor extends (PureComponent || Component) {
initialScrollTop: PropTypes.number, initialScrollTop: PropTypes.number,
}), }),
preserveScrollTop: PropTypes.bool, preserveScrollTop: PropTypes.bool,
stagedActions: PropTypes.array, // stagedActions: PropTypes.array,
select: PropTypes.func.isRequired, select: PropTypes.func.isRequired,
hideResetButton: PropTypes.bool, hideResetButton: PropTypes.bool,
theme: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), theme: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
@ -33,13 +70,13 @@ export default class SliderMonitor extends (PureComponent || Component) {
}; };
static defaultProps = { static defaultProps = {
select: (state) => state, select: (state: unknown) => state,
theme: 'nicinabox', theme: 'nicinabox',
preserveScrollTop: true, preserveScrollTop: true,
keyboardEnabled: true, keyboardEnabled: true,
}; };
state = { state: State = {
timer: undefined, timer: undefined,
replaySpeed: '1x', replaySpeed: '1x',
}; };
@ -56,7 +93,7 @@ export default class SliderMonitor extends (PureComponent || Component) {
} }
} }
setUpTheme = () => { setUpTheme = (): Base16Theme => {
let theme; let theme;
if (typeof this.props.theme === 'string') { if (typeof this.props.theme === 'string') {
if (typeof themes[this.props.theme] !== 'undefined') { if (typeof themes[this.props.theme] !== 'undefined') {
@ -76,7 +113,7 @@ export default class SliderMonitor extends (PureComponent || Component) {
this.props.dispatch(reset()); this.props.dispatch(reset());
}; };
handleKeyPress = (event) => { handleKeyPress = (event: KeyboardEvent) => {
if (!this.props.keyboardEnabled) { if (!this.props.keyboardEnabled) {
return null; return null;
} }
@ -105,7 +142,7 @@ export default class SliderMonitor extends (PureComponent || Component) {
return null; return null;
}; };
handleSliderChange = (value) => { handleSliderChange = (value: number) => {
if (this.state.timer) { if (this.state.timer) {
this.pauseReplay(); this.pauseReplay();
} }
@ -134,7 +171,7 @@ export default class SliderMonitor extends (PureComponent || Component) {
} }
let counter = stateIndex; let counter = stateIndex;
const timer = setInterval(() => { const timer = window.setInterval(() => {
if (counter + 1 <= computedStates.length - 1) { if (counter + 1 <= computedStates.length - 1) {
dispatch(jumpToState(counter + 1)); dispatch(jumpToState(counter + 1));
} }
@ -165,7 +202,7 @@ export default class SliderMonitor extends (PureComponent || Component) {
} }
}; };
loop = (index) => { loop = (index: number) => {
let currentTimestamp = Date.now(); let currentTimestamp = Date.now();
let timestampDiff = this.getLatestTimestampDiff(index); let timestampDiff = this.getLatestTimestampDiff(index);
@ -204,16 +241,16 @@ export default class SliderMonitor extends (PureComponent || Component) {
} }
}; };
getLatestTimestampDiff = (index) => getLatestTimestampDiff = (index: number) =>
this.getTimestampOfStateIndex(index + 1) - this.getTimestampOfStateIndex(index + 1) -
this.getTimestampOfStateIndex(index); this.getTimestampOfStateIndex(index);
getTimestampOfStateIndex = (stateIndex) => { getTimestampOfStateIndex = (stateIndex: number) => {
const id = this.props.stagedActionIds[stateIndex]; const id = this.props.stagedActionIds[stateIndex];
return this.props.actionsById[id].timestamp; return this.props.actionsById[id].timestamp;
}; };
pauseReplay = (cb) => { pauseReplay = (cb?: () => void) => {
if (this.state.timer) { if (this.state.timer) {
cancelAnimationFrame(this.state.timer); cancelAnimationFrame(this.state.timer);
clearInterval(this.state.timer); clearInterval(this.state.timer);
@ -246,7 +283,7 @@ export default class SliderMonitor extends (PureComponent || Component) {
} }
}; };
changeReplaySpeed = (replaySpeed) => { changeReplaySpeed = (replaySpeed: string) => {
this.setState({ replaySpeed }); this.setState({ replaySpeed });
if (this.state.timer) { if (this.state.timer) {
@ -276,7 +313,7 @@ export default class SliderMonitor extends (PureComponent || Component) {
let actionType = actionsById[actionId].action.type; let actionType = actionsById[actionId].action.type;
if (actionType === undefined) actionType = '<UNDEFINED>'; if (actionType === undefined) actionType = '<UNDEFINED>';
else if (actionType === null) actionType = '<NULL>'; else if (actionType === null) actionType = '<NULL>';
else actionType = actionType.toString() || '<EMPTY>'; else actionType = (actionType as string).toString() || '<EMPTY>';
const onPlayClick = const onPlayClick =
replaySpeed === 'Live' ? this.startRealtimeReplay : this.startReplay; replaySpeed === 'Live' ? this.startRealtimeReplay : this.startReplay;
@ -295,7 +332,7 @@ export default class SliderMonitor extends (PureComponent || Component) {
<Toolbar noBorder compact fullHeight theme={theme}> <Toolbar noBorder compact fullHeight theme={theme}>
{playPause} {playPause}
<Slider <Slider
label={actionType} label={actionType as string}
sublabel={`(${actionId})`} sublabel={`(${actionId})`}
min={0} min={0}
max={max} max={max}
@ -332,3 +369,16 @@ export default class SliderMonitor extends (PureComponent || Component) {
); );
} }
} }
export default (SliderMonitor as unknown) as React.ComponentType<
ExternalProps<unknown, Action<unknown>>
> & {
update(
monitorProps: ExternalProps<unknown, Action<unknown>>,
// eslint-disable-next-line @typescript-eslint/ban-types
state: {} | undefined,
action: Action<unknown>
// eslint-disable-next-line @typescript-eslint/ban-types
): {};
defaultProps: DefaultProps;
};

View File

@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.react.base.json",
"compilerOptions": {
"outDir": "lib"
},
"include": ["src"]
}

View File

@ -63,7 +63,7 @@
semver "^5.4.1" semver "^5.4.1"
source-map "^0.5.0" source-map "^0.5.0"
"@babel/core@>=7.9.0", "@babel/core@^7.1.0", "@babel/core@^7.11.0", "@babel/core@^7.11.1", "@babel/core@^7.7.5": "@babel/core@>=7.9.0", "@babel/core@^7.1.0", "@babel/core@^7.11.1", "@babel/core@^7.7.5":
version "7.11.1" version "7.11.1"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.11.1.tgz#2c55b604e73a40dc21b0e52650b11c65cf276643" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.11.1.tgz#2c55b604e73a40dc21b0e52650b11c65cf276643"
integrity sha512-XqF7F6FWQdKGGWAzGELL+aCO1p+lRY5Tj5/tbT3St1G8NaH70jhhDIKknIZaDans0OQBG5wRAldROLHSt44BgQ== integrity sha512-XqF7F6FWQdKGGWAzGELL+aCO1p+lRY5Tj5/tbT3St1G8NaH70jhhDIKknIZaDans0OQBG5wRAldROLHSt44BgQ==