import { type ThunkAction } from '@reduxjs/toolkit'; import type { Operation } from 'ot-json0'; import { ControlInstance } from '@makeswift/controls'; import { type Element, type Document, EMBEDDED_DOCUMENT_TYPE } from './modules/read-only-documents'; import type { DescriptorsByComponentType } from './modules/prop-controllers'; import type { ComponentType } from './modules/react-components'; import type { Measurable, BoxModel } from './modules/box-models'; import { ComponentMeta } from './modules/components-meta'; import { Descriptor as PropControllerDescriptor } from '../prop-controllers/descriptors'; import type { Size } from './react-builder-preview'; import type { PropControllersHandle } from './modules/prop-controller-handles'; import type { PropControllerMessage } from '../prop-controllers/instances'; import type { APIResource, APIResourceType, APIResourceLocale } from '../api/types'; import type { SerializedControl } from '../builder'; import { ElementImperativeHandle } from '../runtimes/react/element-imperative-handle'; import { BuilderEditMode } from './modules/builder-edit-mode'; import type { Point } from './modules/pointer'; import { Breakpoints } from './modules/breakpoints'; import { type SerializedState as APIClientCache } from './makeswift-api-client'; import { LocaleString } from '../locale'; export { type UnknownAction } from '@reduxjs/toolkit'; export declare const ActionTypes: { readonly INIT: "INIT"; readonly CLEAN_UP: "CLEAN_UP"; readonly REGISTER_DOCUMENT: "REGISTER_DOCUMENT"; readonly UNREGISTER_DOCUMENT: "UNREGISTER_DOCUMENT"; readonly CHANGE_DOCUMENT: "CHANGE_DOCUMENT"; readonly CREATE_ELEMENT_TREE: "CREATE_ELEMENT_TREE"; readonly DELETE_ELEMENT_TREE: "DELETE_ELEMENT_TREE"; readonly CHANGE_ELEMENT_TREE: "CHANGE_ELEMENT_TREE"; readonly REGISTER_BUILDER_DOCUMENT: "REGISTER_BUILDER_DOCUMENT"; readonly UNREGISTER_BUILDER_DOCUMENT: "UNREGISTER_BUILDER_DOCUMENT"; readonly REGISTER_COMPONENT: "REGISTER_COMPONENT"; readonly UNREGISTER_COMPONENT: "UNREGISTER_COMPONENT"; readonly REGISTER_BUILDER_COMPONENT: "REGISTER_BUILDER_COMPONENT"; readonly UNREGISTER_BUILDER_COMPONENT: "UNREGISTER_BUILDER_COMPONENT"; readonly REGISTER_REACT_COMPONENT: "REGISTER_REACT_COMPONENT"; readonly UNREGISTER_REACT_COMPONENT: "UNREGISTER_REACT_COMPONENT"; readonly MOUNT_COMPONENT: "MOUNT_COMPONENT"; readonly UNMOUNT_COMPONENT: "UNMOUNT_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 CHANGE_ELEMENT_BOX_MODELS: "CHANGE_ELEMENT_BOX_MODELS"; readonly CHANGE_DOCUMENT_ELEMENT_SIZE: "CHANGE_DOCUMENT_ELEMENT_SIZE"; readonly CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP: "CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP"; readonly SCROLL_DOCUMENT_ELEMENT: "SCROLL_DOCUMENT_ELEMENT"; readonly REGISTER_PROP_CONTROLLERS_HANDLE: "REGISTER_PROP_CONTROLLERS_HANDLE"; readonly UNREGISTER_PROP_CONTROLLERS_HANDLE: "UNREGISTER_PROP_CONTROLLERS_HANDLE"; readonly REGISTER_PROP_CONTROLLERS: "REGISTER_PROP_CONTROLLERS"; readonly UNREGISTER_PROP_CONTROLLERS: "UNREGISTER_PROP_CONTROLLERS"; readonly MESSAGE_HOST_PROP_CONTROLLER: "MESSAGE_HOST_PROP_CONTROLLER"; readonly MESSAGE_BUILDER_PROP_CONTROLLER: "MESSAGE_BUILDER_PROP_CONTROLLER"; readonly CHANGE_API_RESOURCE: "CHANGE_API_RESOURCE"; readonly EVICT_API_RESOURCE: "EVICT_API_RESOURCE"; readonly SET_IS_IN_BUILDER: "SET_IS_IN_BUILDER"; readonly HANDLE_WHEEL: "HANDLE_WHEEL"; readonly HANDLE_POINTER_MOVE: "HANDLE_POINTER_MOVE"; readonly API_RESOURCE_FULFILLED: "API_RESOURCE_FULFILLED"; readonly SET_BUILDER_EDIT_MODE: "SET_BUILDER_EDIT_MODE"; readonly MAKESWIFT_CONNECTION_INIT: "MAKESWIFT_CONNECTION_INIT"; readonly MAKESWIFT_CONNECTION_CHECK: "MAKESWIFT_CONNECTION_CHECK"; readonly BUILDER_POINTER_MOVE: "BUILDER_POINTER_MOVE"; readonly ELEMENT_FROM_POINT_CHANGE: "ELEMENT_FROM_POINT_CHANGE"; readonly SET_BREAKPOINTS: "SET_BREAKPOINTS"; readonly SET_LOCALE: "SET_LOCALE"; readonly SET_LOCALIZED_RESOURCE_ID: "SET_LOCALIZED_RESOURCE_ID"; readonly UPDATE_API_CLIENT_CACHE: "UPDATE_API_CLIENT_CACHE"; }; type InitAction = { type: typeof ActionTypes.INIT; }; type CleanUpAction = { type: typeof ActionTypes.CLEAN_UP; }; type DocumentPayloadBaseDocument = { key: string; rootElement: Element; locale?: string | null; }; type DocumentPayloadEmbeddedDocument = { key: string; locale: string | null; id: string; type: string; name: string; rootElement: Element; meta: { allowLocaleFallback: boolean; requestedLocale: string | null; description?: string; }; __type: typeof EMBEDDED_DOCUMENT_TYPE; }; export type DocumentPayload = DocumentPayloadBaseDocument | DocumentPayloadEmbeddedDocument; type RegisterDocumentAction = { type: typeof ActionTypes.REGISTER_DOCUMENT; payload: { documentKey: string; document: DocumentPayload; }; }; type UnregisterDocumentAction = { type: typeof ActionTypes.UNREGISTER_DOCUMENT; payload: { documentKey: string; }; }; type ChangeDocumentAction = { type: typeof ActionTypes.CHANGE_DOCUMENT; payload: { documentKey: string; operation: Operation; }; }; type CreateElementTreeAction = { type: typeof ActionTypes.CREATE_ELEMENT_TREE; payload: { document: DocumentPayload; descriptors: DescriptorsByComponentType; }; }; type DeleteElementTreeAction = { type: typeof ActionTypes.DELETE_ELEMENT_TREE; payload: { documentKey: string; }; }; type ChangeElementTreeAction = { type: typeof ActionTypes.CHANGE_ELEMENT_TREE; payload: { oldDocument: DocumentPayload; newDocument: DocumentPayload; descriptors: DescriptorsByComponentType; operation: Operation; }; }; type RegisterBuilderDocumentAction = { type: typeof ActionTypes.REGISTER_BUILDER_DOCUMENT; payload: { documentKey: string; document: DocumentPayload; }; }; type UnregisterBuilderDocumentAction = { type: typeof ActionTypes.UNREGISTER_BUILDER_DOCUMENT; payload: { documentKey: string; }; }; type RegisterComponentAction = { type: typeof ActionTypes.REGISTER_COMPONENT; payload: { type: string; meta: ComponentMeta; propControllerDescriptors: Record; }; }; type UnregisterComponentAction = { type: typeof ActionTypes.UNREGISTER_COMPONENT; payload: { type: string; }; }; type RegisterBuilderComponentAction = { type: typeof ActionTypes.REGISTER_BUILDER_COMPONENT; payload: { type: string; meta: ComponentMeta; serializedControls: Record; }; transferables?: Transferable[]; }; type UnregisterBuilderComponentAction = { type: typeof ActionTypes.UNREGISTER_BUILDER_COMPONENT; payload: { type: string; }; }; type RegisterReactComponentAction = { type: typeof ActionTypes.REGISTER_REACT_COMPONENT; payload: { type: string; component: ComponentType; }; }; type UnregisterReactComponentAction = { type: typeof ActionTypes.UNREGISTER_REACT_COMPONENT; payload: { type: string; }; }; type MountComponentAction = { type: typeof ActionTypes.MOUNT_COMPONENT; payload: { documentKey: string; elementKey: string; }; }; type UnmountComponentAction = { type: typeof ActionTypes.UNMOUNT_COMPONENT; payload: { documentKey: string; elementKey: string; }; }; type RegisterComponentHandleAction = { type: typeof ActionTypes.REGISTER_COMPONENT_HANDLE; payload: { documentKey: string; elementKey: string; componentHandle: ElementImperativeHandle; }; }; type UnregisterComponentHandleAction = { type: typeof ActionTypes.UNREGISTER_COMPONENT_HANDLE; payload: { documentKey: string; elementKey: string; }; }; type RegisterMeasurableAction = { type: typeof ActionTypes.REGISTER_MEASURABLE; payload: { documentKey: string; elementKey: string; measurable: Measurable; }; }; type UnregisterMeasurableAction = { type: typeof ActionTypes.UNREGISTER_MEASURABLE; payload: { documentKey: string; elementKey: string; }; }; type ChangeElementBoxModelsAction = { type: typeof ActionTypes.CHANGE_ELEMENT_BOX_MODELS; payload: { changedElementBoxModels: Map>; }; }; type ChangeDocumentElementSizeAction = { type: typeof ActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE; payload: { size: Size; }; }; type ChangeDocumentElementScrollTopAction = { type: typeof ActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP; payload: { scrollTop: number; }; }; type ScrollDocumentElementAction = { type: typeof ActionTypes.SCROLL_DOCUMENT_ELEMENT; payload: { scrollTopDelta: number; }; }; type RegisterPropControllersHandleAction = { type: typeof ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE; payload: { documentKey: string; elementKey: string; handle: PropControllersHandle; }; }; type UnregisterPropControllersHandleAction = { type: typeof ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE; payload: { documentKey: string; elementKey: string; }; }; type RegisterPropControllersAction = { type: typeof ActionTypes.REGISTER_PROP_CONTROLLERS; payload: { documentKey: string; elementKey: string; propControllers: Record; }; }; type UnregisterPropControllersAction = { type: typeof ActionTypes.UNREGISTER_PROP_CONTROLLERS; payload: { documentKey: string; elementKey: string; }; }; type MessageHostPropControllerAction = { type: typeof ActionTypes.MESSAGE_HOST_PROP_CONTROLLER; payload: { documentKey: string; elementKey: string; propName: string; message: T; }; }; type MessageBuilderPropControllerAction = { type: typeof ActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER; payload: { documentKey: string; elementKey: string; propName: string; message: T; }; }; type ChangeAPIResourceAction = { type: typeof ActionTypes.CHANGE_API_RESOURCE; payload: { resource: APIResource; locale?: string | null; }; }; type EvictAPIResourceAction = { type: typeof ActionTypes.EVICT_API_RESOURCE; payload: { id: string; locale?: string | null; }; }; type SetIsInBuilderAction = { type: typeof ActionTypes.SET_IS_IN_BUILDER; payload: boolean; }; type HandleWheelAction = { type: typeof ActionTypes.HANDLE_WHEEL; payload: { deltaX: number; deltaY: number; }; }; type HandlePointerMoveAction = { type: typeof ActionTypes.HANDLE_POINTER_MOVE; payload: { clientX: number; clientY: number; }; }; type APIResourceFulfilledAction = { type: typeof ActionTypes.API_RESOURCE_FULFILLED; payload: { resourceType: APIResourceType; resourceId: string; resource: APIResource | null; locale?: string | null; }; }; type SetBuilderEditModeAction = { type: typeof ActionTypes.SET_BUILDER_EDIT_MODE; payload: { editMode: BuilderEditMode; }; }; type BuilderPointerMoveAction = { type: typeof ActionTypes.BUILDER_POINTER_MOVE; payload: { pointer: Point | null; }; }; type ElementFromPointChangeAction = { type: typeof ActionTypes.ELEMENT_FROM_POINT_CHANGE; payload: { keys: { documentKey: string; elementKey: string; } | null; }; }; export type SetBreakpointsAction = { type: typeof ActionTypes.SET_BREAKPOINTS; payload: { breakpoints: Breakpoints; }; }; type SetLocaleAction = { type: typeof ActionTypes.SET_LOCALE; payload: { locale: LocaleString; pathname?: string; }; }; type SetLocalizedResourceIdAction = { type: typeof ActionTypes.SET_LOCALIZED_RESOURCE_ID; payload: { locale?: string; resourceId: string; localizedResourceId: string | null; }; }; type UpdateAPIClientCache = { type: typeof ActionTypes.UPDATE_API_CLIENT_CACHE; payload: APIClientCache; }; export type Action = InitAction | CleanUpAction | RegisterDocumentAction | UnregisterDocumentAction | ChangeDocumentAction | CreateElementTreeAction | DeleteElementTreeAction | ChangeElementTreeAction | RegisterBuilderDocumentAction | UnregisterBuilderDocumentAction | RegisterComponentAction | UnregisterComponentAction | RegisterBuilderComponentAction | UnregisterBuilderComponentAction | RegisterReactComponentAction | UnregisterReactComponentAction | MountComponentAction | UnmountComponentAction | RegisterComponentHandleAction | UnregisterComponentHandleAction | RegisterMeasurableAction | UnregisterMeasurableAction | ChangeElementBoxModelsAction | ChangeDocumentElementSizeAction | ChangeDocumentElementScrollTopAction | ScrollDocumentElementAction | RegisterPropControllersHandleAction | UnregisterPropControllersHandleAction | RegisterPropControllersAction | UnregisterPropControllersAction | MessageHostPropControllerAction | MessageBuilderPropControllerAction | ChangeAPIResourceAction | EvictAPIResourceAction | SetIsInBuilderAction | HandleWheelAction | HandlePointerMoveAction | APIResourceFulfilledAction | SetBuilderEditModeAction | BuilderPointerMoveAction | ElementFromPointChangeAction | SetBreakpointsAction | SetLocaleAction | SetLocalizedResourceIdAction | UpdateAPIClientCache; export declare function init(): InitAction; export declare function cleanUp(): CleanUpAction; export declare function registerDocument(document: Document): RegisterDocumentAction; export declare function unregisterDocument(documentKey: string): UnregisterDocumentAction; 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 registerBuilderDocument(document: Document): RegisterBuilderDocumentAction; export declare function unregisterBuilderDocument(documentKey: string): UnregisterBuilderDocumentAction; export declare function registerDocumentsEffect(documents: Document[]): ThunkAction<() => void, unknown, unknown, Action>; export declare function registerBuilderDocumentsEffect(documents: Document[]): ThunkAction<() => void, unknown, unknown, Action>; export declare function changeDocument(documentKey: string, operation: Operation): ChangeDocumentAction; export declare function registerComponent(type: string, meta: ComponentMeta, propControllerDescriptors: Record): RegisterComponentAction; export declare function unregisterComponent(type: string): UnregisterComponentAction; export declare function registerComponentEffect(type: string, meta: ComponentMeta, propControllerDescriptors: Record): ThunkAction<() => void, unknown, unknown, Action>; export declare function registerBuilderComponent(payload: RegisterBuilderComponentAction['payload'], transferables?: Transferable[]): RegisterBuilderComponentAction; export declare function unregisterBuilderComponent(payload: UnregisterBuilderComponentAction['payload']): UnregisterBuilderComponentAction; export declare function registerReactComponentEffect(type: string, component: ComponentType): ThunkAction<() => void, unknown, unknown, Action>; export declare function mountComponent(documentKey: string, elementKey: string): MountComponentAction; export declare function unmountComponent(documentKey: string, elementKey: string): UnmountComponentAction; export declare function mountComponentEffect(documentKey: string, elementKey: string): ThunkAction<() => void, unknown, unknown, Action>; 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, Action>; 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, Action>; export declare function changeElementBoxModels(changedElementBoxModels: Map>): ChangeElementBoxModelsAction; export declare function changeDocumentElementSize(size: Size): ChangeDocumentElementSizeAction; export declare function changeDocumentElementScrollTop(scrollTop: number): ChangeDocumentElementScrollTopAction; export declare function scrollDocumentElement(scrollTopDelta: number): ScrollDocumentElementAction; 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): RegisterPropControllersAction; export declare function unregisterPropControllers(documentKey: string, elementKey: string): UnregisterPropControllersAction; export declare function messageHostPropController(documentKey: string, elementKey: string, propName: string, message: T): MessageHostPropControllerAction; export declare function messageBuilderPropController(documentKey: string, elementKey: string, propName: string, message: T): MessageBuilderPropControllerAction; export declare function changeApiResource(resource: R, locale?: APIResourceLocale): ChangeAPIResourceAction; export declare function evictApiResource(id: string, locale?: string | null): EvictAPIResourceAction; export declare function setIsInBuilder(isInBuilder: boolean): SetIsInBuilderAction; export declare function handleWheel(payload: { deltaX: number; deltaY: number; }): HandleWheelAction; export declare function handlePointerMove(payload: { clientX: number; clientY: number; }): HandlePointerMoveAction; export declare function apiResourceFulfilled(resourceType: T, resourceId: string, resource: APIResource | null, locale?: APIResourceLocale): APIResourceFulfilledAction; export declare function setBuilderEditMode(editMode: BuilderEditMode): SetBuilderEditModeAction; export declare function builderPointerMove(pointer: Point | null): BuilderPointerMoveAction; export declare function elementFromPointChange(keys: { documentKey: string; elementKey: string; } | null): ElementFromPointChangeAction; export declare function setBreakpoints(breakpoints: Breakpoints): SetBreakpointsAction; export declare function setLocale(locale: Intl.Locale, pathname?: string): SetLocaleAction; export declare function setLocalizedResourceId({ resourceId, localizedResourceId, locale, }: { resourceId: string; localizedResourceId: string | null; locale?: string; }): SetLocalizedResourceIdAction; export declare function updateAPIClientCache(payload: APIClientCache): UpdateAPIClientCache; export declare function isKnownAction(action: unknown): action is Action; //# sourceMappingURL=actions.d.ts.map