mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 08:30:02 +03:00
More type fixes
This commit is contained in:
parent
b1a71b4a72
commit
f19e1fd1cb
|
@ -45,6 +45,7 @@ import { Features, State } from '../reducers/instances';
|
|||
import { MonitorStateMonitorState } from '../reducers/monitor';
|
||||
import { LiftedAction } from '@redux-devtools/core';
|
||||
import { Data } from '../reducers/reports';
|
||||
import { LiftedState } from '@redux-devtools/instrument';
|
||||
|
||||
let monitorReducer: (
|
||||
monitorProps: unknown,
|
||||
|
@ -363,10 +364,10 @@ export interface LibConfig {
|
|||
}
|
||||
|
||||
export interface RequestBase {
|
||||
id: string;
|
||||
id?: string;
|
||||
instanceId?: string;
|
||||
action?: string;
|
||||
name?: string;
|
||||
name?: string | undefined;
|
||||
libConfig?: LibConfig;
|
||||
actionsById?: string;
|
||||
computedStates?: string;
|
||||
|
@ -376,14 +377,15 @@ export interface RequestBase {
|
|||
}
|
||||
interface InitRequest extends RequestBase {
|
||||
type: 'INIT';
|
||||
action: string;
|
||||
action?: string;
|
||||
payload?: string;
|
||||
}
|
||||
interface ActionRequest extends RequestBase {
|
||||
type: 'ACTION';
|
||||
isExcess: boolean;
|
||||
isExcess?: boolean;
|
||||
nextActionId: number;
|
||||
maxAge: number;
|
||||
batched: boolean;
|
||||
batched?: boolean;
|
||||
}
|
||||
interface StateRequest extends RequestBase {
|
||||
type: 'STATE';
|
||||
|
@ -412,7 +414,7 @@ export type Request =
|
|||
interface UpdateStateAction {
|
||||
type: typeof UPDATE_STATE;
|
||||
request?: Request;
|
||||
id?: string;
|
||||
id?: string | number;
|
||||
}
|
||||
|
||||
interface SetStateAction {
|
||||
|
@ -494,8 +496,8 @@ interface UnsubscribeAction {
|
|||
export interface EmitAction {
|
||||
type: typeof EMIT;
|
||||
message: string;
|
||||
id?: string | false;
|
||||
instanceId?: string;
|
||||
id?: string | number | false;
|
||||
instanceId?: string | number;
|
||||
action?: unknown;
|
||||
state?: unknown;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ type DispatchProps = ResolveThunks<typeof actionCreators>;
|
|||
type Props = StateProps & DispatchProps;
|
||||
|
||||
class InstanceSelector extends Component<Props> {
|
||||
select?: { readonly value: string; readonly label: string }[];
|
||||
select?: { readonly value: string; readonly label: string | number }[];
|
||||
|
||||
render() {
|
||||
this.select = [{ value: '', label: 'Autoselect instances' }];
|
||||
|
|
|
@ -5,7 +5,7 @@ import { Dispatch, MiddlewareAPI } from 'redux';
|
|||
import { ExportRequest, StoreAction } from '../actions';
|
||||
import { StoreState } from '../reducers';
|
||||
|
||||
let toExport: string | undefined;
|
||||
let toExport: string | number | undefined;
|
||||
|
||||
function download(state: string) {
|
||||
const blob = new Blob([state], { type: 'octet/stream' });
|
||||
|
|
|
@ -34,8 +34,8 @@ export interface Features {
|
|||
}
|
||||
|
||||
export interface Options {
|
||||
name?: string;
|
||||
connectionId?: string;
|
||||
name?: string | number;
|
||||
connectionId?: string | number;
|
||||
explicitLib?: string;
|
||||
lib?: string;
|
||||
actionCreators?: ActionCreator[];
|
||||
|
@ -57,9 +57,9 @@ export interface State {
|
|||
|
||||
export interface InstancesState {
|
||||
selected: string | null;
|
||||
current: string;
|
||||
current: string | number;
|
||||
sync: boolean;
|
||||
connections: { [id: string]: string[] };
|
||||
connections: { [id: string]: (string | number)[] };
|
||||
options: { [id: string]: Options };
|
||||
states: { [id: string]: State };
|
||||
persisted?: boolean;
|
||||
|
@ -86,7 +86,7 @@ export const initialState: InstancesState = {
|
|||
function updateState(
|
||||
state: { [id: string]: State },
|
||||
request: Request,
|
||||
id: string,
|
||||
id: string | number,
|
||||
serialize: boolean | undefined
|
||||
) {
|
||||
let payload: State = request.payload as State;
|
||||
|
@ -268,8 +268,8 @@ function removeState(state: InstancesState, connectionId: string) {
|
|||
|
||||
function init(
|
||||
{ type, action, name, libConfig = {} }: Request,
|
||||
connectionId: string,
|
||||
current: string
|
||||
connectionId: string | number,
|
||||
current: string | number
|
||||
): Options {
|
||||
let lib;
|
||||
let actionCreators;
|
||||
|
@ -310,7 +310,7 @@ export default function instances(
|
|||
case UPDATE_STATE: {
|
||||
const { request } = action;
|
||||
if (!request) return state;
|
||||
const connectionId = action.id || request.id;
|
||||
const connectionId = (action.id || request.id)!;
|
||||
const current = request.instanceId || connectionId;
|
||||
let connections = state.connections;
|
||||
let options = state.options;
|
||||
|
|
|
@ -23,7 +23,7 @@ export function sweep(state: State): State {
|
|||
export function nonReduxDispatch(
|
||||
store: MiddlewareAPI<Dispatch<StoreAction>, StoreState>,
|
||||
message: string,
|
||||
instanceId: string,
|
||||
instanceId: string | number,
|
||||
action: DispatchAction,
|
||||
initialState: string | undefined,
|
||||
preInstances?: InstancesState
|
||||
|
|
Loading…
Reference in New Issue
Block a user