import { Form } from './react-tinacms';
import { TinaCMS } from './tina-cms';
export declare const ACTION_TYPES: {
    readonly FORMS_ADD: "forms:add";
    readonly FORMS_REMOVE: "forms:remove";
    readonly FORMS_CLEAR: "forms:clear";
    readonly FORMS_SET_ACTIVE_FORM_ID: "forms:set-active-form-id";
    readonly FORMS_SET_ACTIVE_FIELD_NAME: "forms:set-active-field-name";
    readonly FORMS_SET_HOVERED_FIELD_NAME: "forms:set-hovered-field-name";
    readonly FORM_LISTS_ADD: "form-lists:add";
    readonly FORM_LISTS_REMOVE: "form-lists:remove";
    readonly FORM_LISTS_CLEAR: "form-lists:clear";
    readonly SET_EDIT_MODE: "set-edit-mode";
    readonly INCREMENT_OPERATION_INDEX: "increment-operation-index";
    readonly SET_QUICK_EDITING_SUPPORTED: "set-quick-editing-supported";
    readonly SET_QUICK_EDITING_ENABLED: "set-quick-editing-enabled";
    readonly TOGGLE_QUICK_EDITING_ENABLED: "toggle-quick-editing-enabled";
    readonly TOGGLE_EDIT_STATE: "toggle-edit-state";
    readonly SIDEBAR_SET_DISPLAY_STATE: "sidebar:set-display-state";
    readonly SIDEBAR_SET_LOADING_STATE: "sidebar:set-loading-state";
};
type FormListItem = {
    type: 'document';
    path: string;
    formId: string;
    subItems: FormListItem[];
} | {
    type: 'list';
    label: string;
};
type FormList = {
    label: string;
    id: string;
    items: FormListItem[];
    formIds: string[];
};
type Breadcrumb = {
    label: string;
    formId: string;
    formName: string;
    namespace: string[];
};
export type TinaAction = {
    type: typeof ACTION_TYPES.FORMS_ADD;
    value: Form;
} | {
    type: typeof ACTION_TYPES.FORMS_REMOVE;
    value: string;
} | {
    type: typeof ACTION_TYPES.FORMS_CLEAR;
} | {
    type: typeof ACTION_TYPES.FORM_LISTS_ADD;
    value: FormList;
} | {
    type: typeof ACTION_TYPES.FORM_LISTS_REMOVE;
    value: string;
} | {
    type: typeof ACTION_TYPES.FORMS_SET_ACTIVE_FORM_ID;
    value: string;
} | {
    type: typeof ACTION_TYPES.FORMS_SET_ACTIVE_FIELD_NAME;
    value: {
        formId: string;
        fieldName: string;
    };
} | {
    type: typeof ACTION_TYPES.FORMS_SET_HOVERED_FIELD_NAME;
    value: {
        formId: string;
        fieldName: string | null;
    };
} | {
    type: typeof ACTION_TYPES.FORM_LISTS_CLEAR;
} | {
    type: typeof ACTION_TYPES.SET_EDIT_MODE;
    value: 'visual' | 'basic';
} | {
    type: typeof ACTION_TYPES.INCREMENT_OPERATION_INDEX;
} | {
    type: typeof ACTION_TYPES.SET_QUICK_EDITING_SUPPORTED;
    value: boolean;
} | {
    type: typeof ACTION_TYPES.SET_QUICK_EDITING_ENABLED;
    value?: boolean;
} | {
    type: typeof ACTION_TYPES.TOGGLE_QUICK_EDITING_ENABLED;
} | {
    type: typeof ACTION_TYPES.TOGGLE_EDIT_STATE;
} | {
    type: typeof ACTION_TYPES.SIDEBAR_SET_DISPLAY_STATE;
    value: TinaState['sidebarDisplayState'] | 'openOrFull';
} | {
    type: typeof ACTION_TYPES.SIDEBAR_SET_LOADING_STATE;
    value: boolean;
};
export interface TinaState {
    breadcrumbs: Breadcrumb[];
    activeFormId: string | null;
    /**
     * Forms are wrapped here because we need `activeFieldName` to be reactive, so adding it as a propery
     * on the Form class won't work, unfortunately. So "form" at this level means tinaForm + activeFieldName
     *
     * The activeFieldName should probably not be in global state, and having it here means that forms
     * only work if they're registered as part of this top-level state. At the risk of touching too much code
     * all at once, putting state this high up at least allows us to not have to touch the Form class too much.
     * Longer term, replaceing Form with something stateful seems like the right approach
     */
    forms: {
        activeFieldName?: string | null;
        tinaForm: Form;
        hoveringFieldName?: string | null;
    }[];
    formLists: FormList[];
    editingMode: 'visual' | 'basic';
    isLoadingContent: boolean;
    quickEditSupported: boolean;
    sidebarDisplayState: 'closed' | 'open' | 'fullscreen';
}
export declare const initialState: (cms: TinaCMS) => TinaState;
export declare function tinaReducer(state: TinaState, action: TinaAction): TinaState;
export declare function calculateBreadcrumbs(forms: {
    activeFieldName?: string | null;
    tinaForm: Form;
}[], activeFormId: string, activeFieldName?: string): Breadcrumb[];
export {};
