import { type Operation } from 'ot-json0';
import { type ThunkAction } from '@reduxjs/toolkit';
import { ControlInstance } from '@makeswift/controls';
import { ElementImperativeHandle } from '../../runtimes/react/element-imperative-handle';
import { type APIResource, APIResourceType, APIResourceLocale } from '../../api/types';
import { type Descriptor as PropControllerDescriptor } from '../../prop-controllers/descriptors';
import { type Measurable } from '../modules/box-models';
import { type ComponentMeta } from '../modules/components-meta';
import { type PropControllersHandle } from '../modules/prop-controller-handles';
import { type ComponentType } from '../modules/react-components';
import { type DescriptorsByComponentType } from '../modules/prop-controllers';
import { type DocumentPayload } from '../shared-api';
import { type SerializedState as APIClientCache } from '../makeswift-api-client';
export declare const InternalActionTypes: {
    readonly API_RESOURCE_FULFILLED: "API_RESOURCE_FULFILLED";
    readonly CREATE_ELEMENT_TREE: "CREATE_ELEMENT_TREE";
    readonly DELETE_ELEMENT_TREE: "DELETE_ELEMENT_TREE";
    readonly CHANGE_ELEMENT_TREE: "CHANGE_ELEMENT_TREE";
    readonly REGISTER_COMPONENT: "REGISTER_COMPONENT";
    readonly UNREGISTER_COMPONENT: "UNREGISTER_COMPONENT";
    readonly REGISTER_COMPONENT_HANDLE: "REGISTER_COMPONENT_HANDLE";
    readonly UNREGISTER_COMPONENT_HANDLE: "UNREGISTER_COMPONENT_HANDLE";
    readonly REGISTER_MEASURABLE: "REGISTER_MEASURABLE";
    readonly UNREGISTER_MEASURABLE: "UNREGISTER_MEASURABLE";
    readonly REGISTER_PROP_CONTROLLERS: "REGISTER_PROP_CONTROLLERS";
    readonly UNREGISTER_PROP_CONTROLLERS: "UNREGISTER_PROP_CONTROLLERS";
    readonly REGISTER_PROP_CONTROLLERS_HANDLE: "REGISTER_PROP_CONTROLLERS_HANDLE";
    readonly UNREGISTER_PROP_CONTROLLERS_HANDLE: "UNREGISTER_PROP_CONTROLLERS_HANDLE";
    readonly REGISTER_REACT_COMPONENT: "REGISTER_REACT_COMPONENT";
    readonly UNREGISTER_REACT_COMPONENT: "UNREGISTER_REACT_COMPONENT";
    readonly SET_IS_IN_BUILDER: "SET_IS_IN_BUILDER";
    readonly UPDATE_API_CLIENT_CACHE: "UPDATE_API_CLIENT_CACHE";
};
type APIResourceFulfilledAction = {
    type: typeof InternalActionTypes.API_RESOURCE_FULFILLED;
    payload: {
        resourceType: APIResourceType;
        resourceId: string;
        resource: APIResource | null;
        locale?: string | null;
    };
};
type CreateElementTreeAction = {
    type: typeof InternalActionTypes.CREATE_ELEMENT_TREE;
    payload: {
        document: DocumentPayload;
        descriptors: DescriptorsByComponentType;
    };
};
type DeleteElementTreeAction = {
    type: typeof InternalActionTypes.DELETE_ELEMENT_TREE;
    payload: {
        documentKey: string;
    };
};
type ChangeElementTreeAction = {
    type: typeof InternalActionTypes.CHANGE_ELEMENT_TREE;
    payload: {
        oldDocument: DocumentPayload;
        newDocument: DocumentPayload;
        descriptors: DescriptorsByComponentType;
        operation: Operation;
    };
};
export type RegisterComponentAction = {
    type: typeof InternalActionTypes.REGISTER_COMPONENT;
    payload: {
        type: string;
        meta: ComponentMeta;
        propControllerDescriptors: Record<string, PropControllerDescriptor>;
    };
};
export type UnregisterComponentAction = {
    type: typeof InternalActionTypes.UNREGISTER_COMPONENT;
    payload: {
        type: string;
    };
};
type RegisterComponentHandleAction = {
    type: typeof InternalActionTypes.REGISTER_COMPONENT_HANDLE;
    payload: {
        documentKey: string;
        elementKey: string;
        componentHandle: ElementImperativeHandle;
    };
};
type UnregisterComponentHandleAction = {
    type: typeof InternalActionTypes.UNREGISTER_COMPONENT_HANDLE;
    payload: {
        documentKey: string;
        elementKey: string;
    };
};
type RegisterMeasurableAction = {
    type: typeof InternalActionTypes.REGISTER_MEASURABLE;
    payload: {
        documentKey: string;
        elementKey: string;
        measurable: Measurable;
    };
};
type UnregisterMeasurableAction = {
    type: typeof InternalActionTypes.UNREGISTER_MEASURABLE;
    payload: {
        documentKey: string;
        elementKey: string;
    };
};
type RegisterPropControllersHandleAction = {
    type: typeof InternalActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE;
    payload: {
        documentKey: string;
        elementKey: string;
        handle: PropControllersHandle;
    };
};
type UnregisterPropControllersHandleAction = {
    type: typeof InternalActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE;
    payload: {
        documentKey: string;
        elementKey: string;
    };
};
type RegisterPropControllersAction = {
    type: typeof InternalActionTypes.REGISTER_PROP_CONTROLLERS;
    payload: {
        documentKey: string;
        elementKey: string;
        propControllers: Record<string, ControlInstance>;
    };
};
type UnregisterPropControllersAction = {
    type: typeof InternalActionTypes.UNREGISTER_PROP_CONTROLLERS;
    payload: {
        documentKey: string;
        elementKey: string;
    };
};
type RegisterReactComponentAction = {
    type: typeof InternalActionTypes.REGISTER_REACT_COMPONENT;
    payload: {
        type: string;
        component: ComponentType;
    };
};
type UnregisterReactComponentAction = {
    type: typeof InternalActionTypes.UNREGISTER_REACT_COMPONENT;
    payload: {
        type: string;
    };
};
type SetIsInBuilderAction = {
    type: typeof InternalActionTypes.SET_IS_IN_BUILDER;
    payload: boolean;
};
type UpdateAPIClientCache = {
    type: typeof InternalActionTypes.UPDATE_API_CLIENT_CACHE;
    payload: APIClientCache;
};
export type InternalAction = APIResourceFulfilledAction | CreateElementTreeAction | DeleteElementTreeAction | ChangeElementTreeAction | RegisterComponentAction | UnregisterComponentAction | RegisterComponentHandleAction | UnregisterComponentHandleAction | RegisterMeasurableAction | UnregisterMeasurableAction | RegisterPropControllersHandleAction | UnregisterPropControllersHandleAction | RegisterPropControllersAction | UnregisterPropControllersAction | RegisterReactComponentAction | UnregisterReactComponentAction | SetIsInBuilderAction | UpdateAPIClientCache;
export declare function apiResourceFulfilled<T extends APIResourceType>(resourceType: T, resourceId: string, resource: APIResource | null, locale?: APIResourceLocale<T>): APIResourceFulfilledAction;
export declare function createElementTree(payload: CreateElementTreeAction['payload']): CreateElementTreeAction;
export declare function deleteElementTree(payload: DeleteElementTreeAction['payload']): DeleteElementTreeAction;
export declare function changeElementTree(payload: ChangeElementTreeAction['payload']): ChangeElementTreeAction;
export declare function registerComponent(type: string, meta: ComponentMeta, propControllerDescriptors: Record<string, PropControllerDescriptor>): RegisterComponentAction;
export declare function unregisterComponent(type: string): UnregisterComponentAction;
export declare function registerComponentEffect(type: string, meta: ComponentMeta, propControllerDescriptors: Record<string, PropControllerDescriptor>): ThunkAction<() => void, unknown, unknown, InternalAction>;
export declare function registerComponentHandle(documentKey: string, elementKey: string, componentHandle: ElementImperativeHandle): RegisterComponentHandleAction;
export declare function registerComponentHandleEffect(documentKey: string, elementKey: string, componentHandle: ElementImperativeHandle): ThunkAction<() => void, unknown, unknown, InternalAction>;
export declare function registerMeasurable(documentKey: string, elementKey: string, measurable: Measurable): RegisterMeasurableAction;
export declare function unregisterMeasurable(documentKey: string, elementKey: string): UnregisterMeasurableAction;
export declare function registerMeasurableEffect(documentKey: string, elementKey: string, measurable: Measurable): ThunkAction<() => void, unknown, unknown, InternalAction>;
export declare function registerPropControllersHandle(documentKey: string, elementKey: string, handle: PropControllersHandle): RegisterPropControllersHandleAction;
export declare function unregisterPropControllersHandle(documentKey: string, elementKey: string): UnregisterPropControllersHandleAction;
export declare function registerPropControllers(documentKey: string, elementKey: string, propControllers: Record<string, ControlInstance>): RegisterPropControllersAction;
export declare function unregisterPropControllers(documentKey: string, elementKey: string): UnregisterPropControllersAction;
export declare function registerReactComponentEffect(type: string, component: ComponentType): ThunkAction<() => void, unknown, unknown, InternalAction>;
export declare function setIsInBuilder(isInBuilder: boolean): SetIsInBuilderAction;
export declare function updateAPIClientCache(payload: APIClientCache): UpdateAPIClientCache;
export {};
//# sourceMappingURL=internal.d.ts.map