const InternalActionTypes = {
  API_RESOURCE_FULFILLED: "API_RESOURCE_FULFILLED",
  CREATE_ELEMENT_TREE: "CREATE_ELEMENT_TREE",
  DELETE_ELEMENT_TREE: "DELETE_ELEMENT_TREE",
  CHANGE_ELEMENT_TREE: "CHANGE_ELEMENT_TREE",
  REGISTER_COMPONENT: "REGISTER_COMPONENT",
  UNREGISTER_COMPONENT: "UNREGISTER_COMPONENT",
  REGISTER_COMPONENT_HANDLE: "REGISTER_COMPONENT_HANDLE",
  UNREGISTER_COMPONENT_HANDLE: "UNREGISTER_COMPONENT_HANDLE",
  REGISTER_MEASURABLE: "REGISTER_MEASURABLE",
  UNREGISTER_MEASURABLE: "UNREGISTER_MEASURABLE",
  REGISTER_PROP_CONTROLLERS: "REGISTER_PROP_CONTROLLERS",
  UNREGISTER_PROP_CONTROLLERS: "UNREGISTER_PROP_CONTROLLERS",
  REGISTER_PROP_CONTROLLERS_HANDLE: "REGISTER_PROP_CONTROLLERS_HANDLE",
  UNREGISTER_PROP_CONTROLLERS_HANDLE: "UNREGISTER_PROP_CONTROLLERS_HANDLE",
  REGISTER_REACT_COMPONENT: "REGISTER_REACT_COMPONENT",
  UNREGISTER_REACT_COMPONENT: "UNREGISTER_REACT_COMPONENT",
  SET_IS_IN_BUILDER: "SET_IS_IN_BUILDER",
  UPDATE_API_CLIENT_CACHE: "UPDATE_API_CLIENT_CACHE"
};
function apiResourceFulfilled(resourceType, resourceId, resource, locale) {
  return {
    type: InternalActionTypes.API_RESOURCE_FULFILLED,
    payload: { resourceType, resourceId, resource, locale }
  };
}
function createElementTree(payload) {
  return {
    type: InternalActionTypes.CREATE_ELEMENT_TREE,
    payload
  };
}
function deleteElementTree(payload) {
  return { type: InternalActionTypes.DELETE_ELEMENT_TREE, payload };
}
function changeElementTree(payload) {
  return {
    type: InternalActionTypes.CHANGE_ELEMENT_TREE,
    payload
  };
}
function registerComponent(type, meta, propControllerDescriptors) {
  return {
    type: InternalActionTypes.REGISTER_COMPONENT,
    payload: { type, meta, propControllerDescriptors }
  };
}
function unregisterComponent(type) {
  return { type: InternalActionTypes.UNREGISTER_COMPONENT, payload: { type } };
}
function registerComponentEffect(type, meta, propControllerDescriptors) {
  return (dispatch) => {
    dispatch(registerComponent(type, meta, propControllerDescriptors));
    return () => {
      dispatch(unregisterComponent(type));
    };
  };
}
function registerComponentHandle(documentKey, elementKey, componentHandle) {
  return {
    type: InternalActionTypes.REGISTER_COMPONENT_HANDLE,
    payload: { documentKey, elementKey, componentHandle }
  };
}
function unregisterComponentHandle(documentKey, elementKey) {
  return {
    type: InternalActionTypes.UNREGISTER_COMPONENT_HANDLE,
    payload: { documentKey, elementKey }
  };
}
function registerComponentHandleEffect(documentKey, elementKey, componentHandle) {
  return (dispatch) => {
    dispatch(registerComponentHandle(documentKey, elementKey, componentHandle));
    return () => {
      dispatch(unregisterComponentHandle(documentKey, elementKey));
    };
  };
}
function registerMeasurable(documentKey, elementKey, measurable) {
  return {
    type: InternalActionTypes.REGISTER_MEASURABLE,
    payload: { documentKey, elementKey, measurable }
  };
}
function unregisterMeasurable(documentKey, elementKey) {
  return { type: InternalActionTypes.UNREGISTER_MEASURABLE, payload: { documentKey, elementKey } };
}
function registerMeasurableEffect(documentKey, elementKey, measurable) {
  return (dispatch) => {
    dispatch(registerMeasurable(documentKey, elementKey, measurable));
    return () => {
      dispatch(unregisterMeasurable(documentKey, elementKey));
    };
  };
}
function registerPropControllersHandle(documentKey, elementKey, handle) {
  return {
    type: InternalActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE,
    payload: { documentKey, elementKey, handle }
  };
}
function unregisterPropControllersHandle(documentKey, elementKey) {
  return {
    type: InternalActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE,
    payload: { documentKey, elementKey }
  };
}
function registerPropControllers(documentKey, elementKey, propControllers) {
  return {
    type: InternalActionTypes.REGISTER_PROP_CONTROLLERS,
    payload: { documentKey, elementKey, propControllers }
  };
}
function unregisterPropControllers(documentKey, elementKey) {
  return {
    type: InternalActionTypes.UNREGISTER_PROP_CONTROLLERS,
    payload: { documentKey, elementKey }
  };
}
function registerReactComponent(type, component) {
  return { type: InternalActionTypes.REGISTER_REACT_COMPONENT, payload: { type, component } };
}
function unregisterReactComponent(type) {
  return { type: InternalActionTypes.UNREGISTER_REACT_COMPONENT, payload: { type } };
}
function registerReactComponentEffect(type, component) {
  return (dispatch) => {
    dispatch(registerReactComponent(type, component));
    return () => {
      dispatch(unregisterReactComponent(type));
    };
  };
}
function setIsInBuilder(isInBuilder) {
  return { type: InternalActionTypes.SET_IS_IN_BUILDER, payload: isInBuilder };
}
function updateAPIClientCache(payload) {
  return { type: InternalActionTypes.UPDATE_API_CLIENT_CACHE, payload };
}
export {
  InternalActionTypes,
  apiResourceFulfilled,
  changeElementTree,
  createElementTree,
  deleteElementTree,
  registerComponent,
  registerComponentEffect,
  registerComponentHandle,
  registerComponentHandleEffect,
  registerMeasurable,
  registerMeasurableEffect,
  registerPropControllers,
  registerPropControllersHandle,
  registerReactComponentEffect,
  setIsInBuilder,
  unregisterComponent,
  unregisterMeasurable,
  unregisterPropControllers,
  unregisterPropControllersHandle,
  updateAPIClientCache
};
//# sourceMappingURL=internal.js.map