import { SchemeName, ThemeName } from '@redux-devtools/ui';
import { AuthStates, States } from 'socketcluster-client/lib/clientsocket';
import { REHYDRATE } from 'redux-persist';
import { CHANGE_SECTION, CHANGE_THEME, SELECT_INSTANCE, SELECT_MONITOR, UPDATE_MONITOR_STATE, LIFTED_ACTION, MONITOR_ACTION, EXPORT, TOGGLE_SYNC, TOGGLE_SLIDER, TOGGLE_DISPATCHER, TOGGLE_PERSIST, GET_REPORT_REQUEST, SHOW_NOTIFICATION, CLEAR_NOTIFICATION, UPDATE_STATE, UPDATE_REPORTS, REMOVE_INSTANCE, SET_STATE, GET_REPORT_ERROR, GET_REPORT_SUCCESS, ERROR, SET_PERSIST, CHANGE_STATE_TREE_SETTINGS } from '../constants/actionTypes';
import { AUTH_ERROR, AUTH_REQUEST, AUTH_SUCCESS, CONNECT_ERROR, CONNECT_REQUEST, CONNECT_SUCCESS, DEAUTHENTICATE, DISCONNECTED, EMIT, RECONNECT, SUBSCRIBE_ERROR, SUBSCRIBE_REQUEST, SUBSCRIBE_SUCCESS, UNSUBSCRIBE } from '../constants/socketActionTypes';
import { Action } from 'redux';
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/core';
export interface ChangeSectionAction {
    readonly type: typeof CHANGE_SECTION;
    readonly section: string;
}
export declare function changeSection(section: string): ChangeSectionAction;
interface ChangeThemeFormData {
    readonly theme: ThemeName;
    readonly scheme: SchemeName;
    readonly colorPreference: 'auto' | 'light' | 'dark';
}
interface ChangeThemeData {
    readonly formData: ChangeThemeFormData;
}
export interface ChangeThemeAction {
    readonly type: typeof CHANGE_THEME;
    readonly theme: ThemeName;
    readonly scheme: SchemeName;
    readonly colorPreference: 'auto' | 'light' | 'dark';
}
export declare function changeTheme(data: ChangeThemeData): ChangeThemeAction;
interface ChangeStateTreeSettingsFormData {
    readonly sortAlphabetically: boolean;
    readonly disableCollection: boolean;
}
interface ChangeStateTreeSettingsData {
    readonly formData: ChangeStateTreeSettingsFormData;
}
export interface ChangeStateTreeSettingsAction {
    readonly type: typeof CHANGE_STATE_TREE_SETTINGS;
    readonly sortAlphabetically: boolean;
    readonly disableCollection: boolean;
}
export declare function changeStateTreeSettings(data: ChangeStateTreeSettingsData): ChangeStateTreeSettingsAction;
export interface InitMonitorAction {
    type: '@@INIT_MONITOR';
    newMonitorState: unknown;
    update: (monitorProps: unknown, state: unknown | undefined, action: Action<string>) => unknown;
    monitorProps: unknown;
}
export interface MonitorActionAction {
    type: typeof MONITOR_ACTION;
    action: InitMonitorAction;
    monitorReducer: (monitorProps: unknown, state: unknown | undefined, action: Action<string>) => unknown;
    monitorProps: unknown;
}
export interface JumpToStateAction {
    type: 'JUMP_TO_STATE';
    index: number;
}
export interface JumpToActionAction {
    type: 'JUMP_TO_ACTION';
    actionId: number;
}
export interface PauseRecordingAction {
    type: 'PAUSE_RECORDING';
    status: boolean;
}
export interface LockChangesAction {
    type: 'LOCK_CHANGES';
    status: boolean;
}
export interface ToggleActionAction {
    type: 'TOGGLE_ACTION';
    id: number;
}
export interface RollbackAction {
    type: 'ROLLBACK';
    timestamp: number;
}
export interface SweepAction {
    type: 'SWEEP';
}
interface ReorderActionAction {
    type: 'REORDER_ACTION';
    actionId: number;
    beforeActionId: number;
}
interface ImportStateAction {
    type: 'IMPORT_STATE';
    nextLiftedState: LiftedState<unknown, Action<string>, unknown> | readonly Action<string>[];
    preloadedState?: unknown;
    noRecompute?: boolean | undefined;
}
export type DispatchAction = JumpToStateAction | JumpToActionAction | PauseRecordingAction | LockChangesAction | ToggleActionAction | RollbackAction | SweepAction | ReorderActionAction | ImportStateAction;
interface LiftedActionActionBase {
    action?: DispatchAction | string | CustomAction;
    state?: string;
    toAll?: boolean;
}
export interface LiftedActionDispatchAction extends LiftedActionActionBase {
    type: typeof LIFTED_ACTION;
    message: 'DISPATCH';
    action: DispatchAction;
    toAll?: boolean;
}
export interface LiftedActionImportAction extends LiftedActionActionBase {
    type: typeof LIFTED_ACTION;
    message: 'IMPORT';
    state: string;
    preloadedState: unknown | undefined;
}
export interface LiftedActionActionAction extends LiftedActionActionBase {
    type: typeof LIFTED_ACTION;
    message: 'ACTION';
    action: string | CustomAction;
}
export interface LiftedActionExportAction extends LiftedActionActionBase {
    type: typeof LIFTED_ACTION;
    message: 'EXPORT';
    toExport: boolean;
}
export type LiftedActionAction = LiftedActionDispatchAction | LiftedActionImportAction | LiftedActionActionAction | LiftedActionExportAction;
export declare function liftedDispatch(action: InitMonitorAction | JumpToStateAction | JumpToActionAction | LiftedAction<unknown, Action<string>, unknown>): MonitorActionAction | LiftedActionDispatchAction;
export interface SelectInstanceAction {
    type: typeof SELECT_INSTANCE;
    selected: string | number;
}
export declare function selectInstance(selected: string): SelectInstanceAction;
export interface SelectMonitorAction {
    type: typeof SELECT_MONITOR;
    monitor: string;
    monitorState?: MonitorStateMonitorState;
}
export declare function selectMonitor(monitor: string): SelectMonitorAction;
export declare function selectMonitorWithState(value: string, monitorState: MonitorStateMonitorState): SelectMonitorAction;
interface NextState {
    subTabName: string;
    inspectedStatePath?: string[];
}
export interface UpdateMonitorStateAction {
    type: typeof UPDATE_MONITOR_STATE;
    nextState: NextState;
}
export declare function selectMonitorTab(subTabName: string): UpdateMonitorStateAction;
export declare function updateMonitorState(nextState: NextState): UpdateMonitorStateAction;
export declare function importState(state: string, preloadedState?: unknown): LiftedActionImportAction;
export interface ExportAction {
    type: typeof EXPORT;
}
export declare function exportState(): ExportAction;
export declare function lockChanges(status: boolean): LiftedActionDispatchAction;
export declare function pauseRecording(status: boolean): LiftedActionDispatchAction;
export interface CustomAction {
    name: string;
    selected: number;
    args: string[];
    rest: string;
}
export declare function dispatchRemotely(action: string | CustomAction): LiftedActionActionAction;
export interface TogglePersistAction {
    type: typeof TOGGLE_PERSIST;
}
export declare function togglePersist(): TogglePersistAction;
export interface SetPersistAction {
    type: typeof SET_PERSIST;
    payload: boolean;
}
export declare function setPersist(persist: boolean): SetPersistAction;
export interface ToggleSyncAction {
    type: typeof TOGGLE_SYNC;
}
export declare function toggleSync(): ToggleSyncAction;
export interface ToggleSliderAction {
    type: typeof TOGGLE_SLIDER;
}
export declare function toggleSlider(): ToggleSliderAction;
export interface ToggleDispatcherAction {
    type: typeof TOGGLE_DISPATCHER;
}
export declare function toggleDispatcher(): ToggleDispatcherAction;
export type ConnectionType = 'disabled' | 'custom';
export interface ConnectionOptions {
    readonly type: ConnectionType;
    readonly hostname: string;
    readonly port: number;
    readonly secure: boolean;
}
export interface ReconnectAction {
    readonly type: typeof RECONNECT;
    readonly options: ConnectionOptions;
}
export declare function saveSocketSettings(options: ConnectionOptions): ReconnectAction;
interface Notification {
    readonly type: 'error';
    readonly message: string;
}
export interface ShowNotificationAction {
    readonly type: typeof SHOW_NOTIFICATION;
    readonly notification: Notification;
}
export declare function showNotification(message: string): ShowNotificationAction;
export interface ClearNotificationAction {
    readonly type: typeof CLEAR_NOTIFICATION;
}
export declare function clearNotification(): ClearNotificationAction;
export interface GetReportRequest {
    readonly type: typeof GET_REPORT_REQUEST;
    readonly report: unknown;
}
export declare function getReport(report: unknown): GetReportRequest;
export interface ActionCreator {
    args: string[];
    name: string;
}
export interface LibConfig {
    actionCreators?: string;
    name?: string;
    type?: string;
    features?: Features;
    serialize?: boolean;
}
export interface RequestBase {
    id?: string;
    instanceId?: string | number;
    action?: string;
    name?: string | undefined;
    libConfig?: LibConfig;
    actionsById?: string;
    computedStates?: string;
    payload?: {} | string;
    liftedState?: Partial<State>;
}
interface InitRequest extends RequestBase {
    type: 'INIT';
    action?: string;
    payload?: string;
}
interface ActionRequest extends RequestBase {
    type: 'ACTION';
    isExcess?: boolean;
    nextActionId: number;
    maxAge: number;
    batched?: boolean;
}
interface StateRequest extends RequestBase {
    type: 'STATE';
    committedState: unknown;
}
interface PartialStateRequest extends RequestBase {
    type: 'PARTIAL_STATE';
    committedState: unknown;
    maxAge: number;
}
interface LiftedRequest extends RequestBase {
    type: 'LIFTED';
}
export interface ExportRequest extends RequestBase {
    type: 'EXPORT';
    committedState: unknown;
}
export type Request = InitRequest | ActionRequest | StateRequest | PartialStateRequest | LiftedRequest | ExportRequest;
export interface UpdateStateAction {
    type: typeof UPDATE_STATE;
    request?: Request;
    id?: string | number;
}
export interface SetStateAction {
    type: typeof SET_STATE;
    newState: State;
}
export interface RemoveInstanceAction {
    type: typeof REMOVE_INSTANCE;
    id: string | number;
}
export interface ConnectRequestAction {
    type: typeof CONNECT_REQUEST;
}
interface ConnectSuccessPayload {
    id: string;
    authState: AuthStates;
    socketState: States;
}
export interface ConnectSuccessAction {
    type: typeof CONNECT_SUCCESS;
    payload: ConnectSuccessPayload;
    error: Error | undefined;
}
export interface ConnectErrorAction {
    type: typeof CONNECT_ERROR;
    error: Error | undefined;
}
export interface AuthRequestAction {
    type: typeof AUTH_REQUEST;
}
export interface AuthSuccessAction {
    type: typeof AUTH_SUCCESS;
    baseChannel: string;
}
export interface AuthErrorAction {
    type: typeof AUTH_ERROR;
    error: Error;
}
export interface DisconnectedAction {
    type: typeof DISCONNECTED;
    code: number;
}
export interface DeauthenticateAction {
    type: typeof DEAUTHENTICATE;
}
export interface SubscribeRequestAction {
    type: typeof SUBSCRIBE_REQUEST;
    channel: string;
    subscription: typeof UPDATE_STATE | typeof UPDATE_REPORTS;
}
export interface SubscribeSuccessAction {
    type: typeof SUBSCRIBE_SUCCESS;
    channel: string;
}
export interface SubscribeErrorAction {
    type: typeof SUBSCRIBE_ERROR;
    error: Error;
    status: string;
}
export interface UnsubscribeAction {
    type: typeof UNSUBSCRIBE;
    channel: string;
}
export interface EmitAction {
    type: typeof EMIT;
    message: string;
    id?: string | number | false;
    instanceId?: string | number;
    action?: unknown;
    state?: unknown;
}
interface ListRequest {
    type: 'list';
    data: Data[];
}
interface AddRequest {
    type: 'add';
    data: Data;
}
interface RemoveRequest {
    type: 'remove';
    data: Data;
    id: unknown;
}
export type UpdateReportsRequest = ListRequest | AddRequest | RemoveRequest;
export interface UpdateReportsAction {
    type: typeof UPDATE_REPORTS;
    request: UpdateReportsRequest;
}
export interface GetReportError {
    type: typeof GET_REPORT_ERROR;
    error: Error;
}
export interface GetReportSuccess {
    type: typeof GET_REPORT_SUCCESS;
    data: {
        payload: string;
    };
}
export interface ErrorAction {
    type: typeof ERROR;
    payload: string;
}
interface ReduxPersistRehydrateAction {
    type: typeof REHYDRATE;
    payload: unknown;
}
export type StoreActionWithoutUpdateStateOrLiftedAction = ChangeSectionAction | ChangeThemeAction | ChangeStateTreeSettingsAction | MonitorActionAction | SelectInstanceAction | SelectMonitorAction | UpdateMonitorStateAction | ExportAction | TogglePersistAction | SetPersistAction | ToggleSyncAction | ToggleSliderAction | ToggleDispatcherAction | ReconnectAction | ShowNotificationAction | ClearNotificationAction | GetReportRequest | SetStateAction | RemoveInstanceAction | ConnectRequestAction | ConnectSuccessAction | ConnectErrorAction | AuthRequestAction | AuthSuccessAction | AuthErrorAction | DisconnectedAction | DeauthenticateAction | SubscribeRequestAction | SubscribeSuccessAction | SubscribeErrorAction | UnsubscribeAction | EmitAction | UpdateReportsAction | GetReportError | GetReportSuccess | ErrorAction | ReduxPersistRehydrateAction;
export type StoreActionWithoutUpdateState = StoreActionWithoutUpdateStateOrLiftedAction | LiftedActionAction;
export type StoreActionWithoutLiftedAction = StoreActionWithoutUpdateStateOrLiftedAction | UpdateStateAction;
export type StoreAction = StoreActionWithoutUpdateState | UpdateStateAction;
export {};
