import { ActionFromReducer } from '@reduxjs/toolkit';
import { BoxProps } from '@mui/material';
import { createAction } from '@reduxjs/toolkit';
import { createAsyncThunk } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import { default as default_2 } from 'react';
import { DefaultEventsMap } from '@socket.io/component-emitter';
import { Dispatch } from 'redux';
import { DrawerProps } from '@mui/material';
import { EnhancedStore } from '@reduxjs/toolkit';
import { FC } from 'react';
import { IconButtonProps } from '@mui/material';
import { JSX as JSX_2 } from 'react/jsx-runtime';
import { ManagerOptions } from 'socket.io-client';
import { PreloadedStateShapeFromReducersMapObject } from 'redux';
import { Reducer } from '@reduxjs/toolkit';
import { ReducerFromReducersMapObject } from '@reduxjs/toolkit';
import { Socket } from 'socket.io-client';
import { SocketOptions } from 'socket.io-client';
import { StateFromReducersMapObject } from '@reduxjs/toolkit';
import { StoreEnhancer } from 'redux';
import { ThemeOptions } from '@material-ui/core/styles';
import { ThunkDispatch } from 'redux-thunk';
import { ToolbarProps } from '@mui/material';
import { Tuple } from '@reduxjs/toolkit';
import { UnknownAction } from 'redux';

export declare const AppWithToolbarDrawer: FC<AppWithToolbarDrawerConfig>;

export declare interface AppWithToolbarDrawerConfig {
    themeOptions?: ThemeOptions;
    toolbar?: AppWithToolbarDrawerConfigToolbar;
    drawer?: AppWithToolbarDrawerConfigDrawer;
    children?: default_2.JSX.Element;
}

export declare interface AppWithToolbarDrawerConfigDrawer {
    options?: DrawerProps;
    container?: BoxProps;
    layout?: AppWithToolbarDrawerConfigLayoutDrawer;
}

export declare interface AppWithToolbarDrawerConfigLayoutDrawer {
    Menu?: default_2.JSX.Element;
}

export declare interface AppWithToolbarDrawerConfigLayoutToolbar {
    Toolbar?: default_2.JSX.Element;
}

export declare interface AppWithToolbarDrawerConfigToolbar {
    options?: ToolbarProps;
    iconButton?: IconButtonProps;
    icon?: default_2.JSX.Element;
    layout?: AppWithToolbarDrawerConfigLayoutToolbar;
}

export { createAction }

export { createAsyncThunk }

export { createSlice }

declare const _default: {
    useDispatch: typeof useDispatch;
    useSelector: typeof useSelector;
};

declare namespace DKA {
    export {
        Widget,
        Template,
        Redux,
        ReduxHook,
        Hook,
        Provider
    }
}
export { DKA }

export declare const GeoAdministrative: FC<GeoAdministrativeSelectionProps>;

export declare type GeoAdministrativeConfig = GeoAdministrativeConfigURL | GeoAdministrativeConfigLocal | GeoAdministrativeConfigFirestore | GeoAdministrativeConfigDatabase;

export declare interface GeoAdministrativeConfigDatabase {
    type: GeoAdministrativeType.FIREBASE_DATABASE;
    credential: any;
}

export declare interface GeoAdministrativeConfigFirestore {
    type: GeoAdministrativeType.FIREBASE_FIRESTORE;
}

export declare interface GeoAdministrativeConfigLocal {
    type: GeoAdministrativeType.LOCAL;
    province?: Array<{
        id: string;
        name: string;
    }>;
    regency?: Array<{
        id: string;
        province_id: string;
        name: string;
    }>;
    district?: Array<{
        id: string;
        regency_id: string;
        name: string;
    }>;
    village?: Array<{
        id: string;
        district_id: string;
        name: string;
    }>;
}

export declare interface GeoAdministrativeConfigURL {
    type: GeoAdministrativeType.URL;
    host?: `${Protocol}${string}`;
    endpoint?: GeoAdministrativeConfigURLEndpoint;
}

export declare interface GeoAdministrativeConfigURLEndpoint {
    province?: `/${string}`;
    regency?: `/${string}`;
    district?: `/${string}`;
    village?: `/${string}`;
}

export declare interface GeoAdministrativeModels {
    province?: never;
    regency?: unknown;
    district?: unknown;
    village?: unknown;
}

export declare interface GeoAdministrativeSelectionProps {
    defaultValue?: GeoAdministrativeModels;
    config?: GeoAdministrativeConfig;
    onChange?: (data: GeoAdministrativeModels) => void;
}

export declare enum GeoAdministrativeType {
    URL = 0,
    LOCAL = 1,
    FIREBASE_FIRESTORE = 2,
    FIREBASE_DATABASE = 3
}

declare namespace Hook {
    export {
        useWindowSize,
        useSocketIOState,
        useSocketIOConnector
    }
}

export declare type onChangeEventAutoCompleteTypes = (event?: default_2.SyntheticEvent, value: any, reason: string, details?: string | unknown) => void;

export declare type Protocol = "http://" | "https://";

declare namespace Provider {
    export {
        SocketIOProvider
    }
}

declare interface ProviderProps {
    reducers: ProviderReducer;
    children: default_2.JSX.Element;
}

declare type ProviderReducer = Reducer;

export declare function Reducers<T>(listReducers: T): T[keyof T] extends Reducer<any, any, any> | undefined ? Reducer<StateFromReducersMapObject<T>, ActionFromReducer<ReducerFromReducersMapObject<T>>, Partial<PreloadedStateShapeFromReducersMapObject<T>>> : never;

declare namespace Redux {
    export {
        Store,
        _default as Hook,
        Reducers,
        ReduxProvider as Provider
    }
}
export { Redux }

declare namespace ReduxHook {
    export {
        useDispatch,
        useSelector,
        _default as default
    }
}

export declare function ReduxProvider<T extends ProviderProps>(props: T): JSX_2.Element;

declare interface SignInForm {
    username: string | undefined;
    password: string | undefined;
}

export declare function SignInSide(config?: SignInSideConfiguration): JSX_2.Element;

declare interface SignInSideConfiguration {
    onSubmit?: (loginData: SignInForm) => void;
}

declare interface SocketIOConfig {
    host?: string;
    port?: number;
    settings?: Partial<ManagerOptions & SocketOptions> | undefined;
}

declare type SocketIOConnectorCallback = Socket<DefaultEventsMap, DefaultEventsMap>;

export declare function SocketIOProvider(props: SocketIOProviderProps): JSX_2.Element;

/**
 * SocketIO ProvidersProps Data
 * On Typing Props
 */
export declare interface SocketIOProviderProps {
    children?: default_2.JSX.Element;
}

export declare interface SocketIOState {
    state?: SocketIOStates;
    message?: string | Error;
}

export declare interface SocketIOStateCallback {
    socket?: Socket<DefaultEventsMap, DefaultEventsMap> | undefined;
    state?: SocketIOState | undefined;
}

export declare enum SocketIOStates {
    ON_CONNECT = "CONNECT",
    ON_CONNECT_ERROR = "CONNECT_ERROR",
    ON_DISCONNECT = "DISCONNECT",
    IDLE = "IDLE"
}

export declare const StepperLayout: FC<StepperLayoutConfig>;

export declare interface StepperLayoutConfig {
    item: StepperLayoutItem;
    onFinish?: () => void;
}

export declare type StepperLayoutItem = Array<StepperLayoutItemModel>;

export declare interface StepperLayoutItemModel {
    title: string;
    icon: default_2.ReactElement;
    children: default_2.JSX.Element;
    onBack?: () => void;
    onNext?: () => void;
}

declare function Store<T extends Reducer>(reducer: T): EnhancedStore<any, UnknownAction, Tuple<[StoreEnhancer<    {
dispatch: ThunkDispatch<any, undefined, UnknownAction>;
}>, StoreEnhancer]>>;

declare namespace Template {
    export {
        AppWithToolbarDrawer,
        StepperLayout,
        SignInSide
    }
}

export declare function useDispatch(): Dispatch<UnknownAction>;

export declare function useSelector<T>(selector: (state: T) => any): any;

export declare function useSocketIOConnector(props?: SocketIOConfig): SocketIOConnectorCallback;

export declare function useSocketIOState(): SocketIOState;

export declare function useWindowSize(): useWindowSizeCallback;

declare type useWindowSizeCallback = [
witdh: number,
height: number
];

declare namespace Widget {
    export {
        GeoAdministrative
    }
}
export { Widget }

export { }


declare module '@mui/material/styles/createPalette' {
    interface ColorRange {
        50: string;
        100: string;
        200: string;
        300: string;
        400: string;
        500: string;
        600: string;
        700: string;
        800: string;
        900: string;
    }
    interface PaletteColor extends ColorRange {
    }
}


declare module '@mui/material/styles/createPalette' {
    interface ColorRange {
        50: string;
        100: string;
        200: string;
        300: string;
        400: string;
        500: string;
        600: string;
        700: string;
        800: string;
        900: string;
    }
    interface PaletteColor extends ColorRange {
    }
}

