import { Dispatch, FC, ReactNode } from 'react';
import { ICreateNewFilePayload, IOpenModalPayload, IOpenModalReturnValue, ITreeItem, ISettingsState, TSettingPath } from '@ws-ui/shared';
import { ISettingsEditorStateAdapter } from '../types';
export type TWebform = {
    name: string;
};
interface IReducerState {
    tabPath: string | null;
    preferences: Partial<ISettingsState>;
    qodly: boolean;
    explorer: ITreeItem[];
    webforms: TWebform[];
}
type ReducerAction = {
    type: 'SET_TAB_PATH';
    payload: string | null;
} | {
    type: 'SET_PREFERENCES';
    payload: Partial<ISettingsState>;
} | {
    type: 'SET_QODLY';
    payload: boolean;
} | {
    type: 'SET_EXPLORER';
    payload: ITreeItem[];
} | {
    type: 'SET_WEBFORMS';
    payload: TWebform[];
} | {
    type: 'SET_SETTING';
    payload: {
        path: TSettingPath;
        settingsKey: string;
        value: unknown;
    };
} | {
    type: 'SET_SETTINGS_AS_TEXT';
    payload: {
        path: TSettingPath;
        settings: Record<string, unknown>;
    };
};
interface IExternalActions {
    onFetchFolderContentWithoutExpanding?: (path: string) => Promise<unknown> | unknown;
    onCreateNewFileAndOpen?: (payload: ICreateNewFilePayload) => Promise<unknown> | unknown;
    onOpenModal?: (config: IOpenModalPayload) => Promise<IOpenModalReturnValue> | IOpenModalReturnValue;
}
interface IReducerValue {
    state: IReducerState;
    dispatch: Dispatch<ReducerAction>;
    externalActions: IExternalActions;
}
export interface IReducerAdapterProps extends IExternalActions {
    children: ReactNode;
    tabPath?: string | null;
    preferences?: Partial<ISettingsState>;
    qodly?: boolean;
    explorer?: ITreeItem[];
    webforms?: TWebform[];
    onChange?: (preferences: Partial<ISettingsState>) => void;
}
export declare const defaultPreferences: Partial<ISettingsState>;
export declare const EditorStateContext: import('react').Context<IReducerValue | null>;
export declare const ReducerAdapterProvider: FC<IReducerAdapterProps>;
export declare function useReducerAdapter(tabPath?: string | null): ISettingsEditorStateAdapter;
export {};
