import { IconName } from "@subframe/core";
import { ComponentDefinitionInfosMap } from "./helper-types";
import { ComponentDefinition, CustomComponentInstance, DeviceType, InstancePropsOnlyValues, InstancePropsOnlyVariantValues, LayoutData, NodeId, NodeMap, NodeType, NodeTypeCanHavePopover, NodeTypeRenderable, NodeTypeWithChildren, NodeTypeWithPopover, NodeWithSlot, PopoverPlacement, PopoverRootNode, PopoverType, PropDefinition, PropDefinitionType, Selector, SelectorData, Selectors, SelectorsMap, SizeData, SizeDataWithParentDirection, SlotInstancePrimitive, ValueOrPropDefinitionInstance } from "./types";
export declare function getValueOrDefaultValue<T extends ValueOrPropDefinitionInstance>(value: T, propDefinitions: PropDefinition[]): T & {
    category: "value";
};
/**
 * Duplicates an array of nodes
 */
export declare function duplicateNodes(nodes: NodeType[]): {
    nodes: NodeType[];
    remappedNodeIds: {
        [oldId: NodeId]: NodeId;
    };
};
export declare const getValueFromInstancePropOrUseDefault: ({ value, instanceProps, propDefinitions, }: {
    value: ValueOrPropDefinitionInstance;
    instanceProps: InstancePropsOnlyValues | null;
    propDefinitions: PropDefinition[];
}) => ValueOrPropDefinitionInstance;
/**
 * Duplicates a node and all of its descendants; will re-id components too
 *
 * If unlinkPropDefinitions is true, then we  will copy the default values of propDefinitions into the new nodes so that
 * none of the new nodes have prop definition instances
 *
 * @returns an array of nodes, with the first node being the root node
 */
export declare function duplicateNodeAndDescendants(component: ComponentDefinition, nodeToBeDuplicatedId: NodeId, { unlinkPropDefinitions, applicableSelectors, instanceProps, }?: {
    unlinkPropDefinitions?: boolean;
    applicableSelectors?: Selector[];
    instanceProps?: InstancePropsOnlyValues;
}): {
    nodes: NodeType[];
    remappedNodeIds: {
        [oldId: NodeId]: NodeId;
    };
};
/**
 * Parent / child relationships
 */
export declare function canParentAcceptNode(parent: NodeType, node: NodeType, nodes: NodeMap, // nodes of the current component
currentComponentId: string, definitionInfosMap: ComponentDefinitionInfosMap): boolean;
/**
 * Popover related
 */
export declare function getPopoverRootAncestorOfNode(node: NodeType, nodes: NodeMap): PopoverRootNode | undefined;
export declare function getRadixPropsForPopoverPlacement(placement: PopoverPlacement): {
    side: "top" | "bottom" | "left" | "right";
    align: "start" | "center" | "end";
};
/**
 * Helper functions for the name / display name of nodes
 */
export declare function getIconForNodeType(type: NodeType["type"]): IconName;
export declare function getNameForNode(node: Exclude<NodeType, SlotInstancePrimitive>): string;
export declare function getLabelForPropDefinition(propDefinitionType: PropDefinitionType): string;
export declare function getIconForPropDefinition(propDefinitionType: PropDefinitionType): IconName;
export declare function getDefaultSelectorData(definition: ComponentDefinition): SelectorData;
export declare function getSelectorName(selector: Selector, propDefinitions: PropDefinition[], showFullName?: boolean): string;
export declare function getDisplayNameForPopoverType(popoverType: PopoverType["type"], condensed?: boolean): string;
/**
 * "is"-related functions, ie functions that help identify a node's type
 */
export declare function isInstanceDisabled(definition: ComponentDefinition, instance: CustomComponentInstance): boolean;
export declare function isInteractiveDefinition(definition: ComponentDefinition): boolean;
export declare function isDisabledOverride(isRootNode: boolean, instanceProps: InstancePropsOnlyVariantValues): boolean;
export declare function isNodeWithSlot(node: NodeType): node is NodeWithSlot;
export declare function ensureIsNodeWithSlot(node: NodeType): NodeWithSlot;
export declare function isNodeEditableText(node: NodeType): boolean;
export declare function isNodeSelectable(definition: ComponentDefinition, nodeId: NodeId): boolean;
export declare function isNodeDeletable(definition: ComponentDefinition, nodeId: NodeId): boolean;
export declare function areComponentDefinitionsEqual(def1: ComponentDefinition, def2: ComponentDefinition): boolean;
/**
 * "is" functions but for components
 */
export declare function isPrebuiltComponent(componentId: string): boolean;
/**
 * Functions that help deal with functionality
 */
export declare const canDetachComponent: (componentType: ComponentDefinition["type"]) => boolean;
export declare function canAddPropDefinitions(definition: ComponentDefinition): boolean;
export declare function canHavePageLayout(definition: ComponentDefinition): boolean;
export declare function canNodeHavePopovers(node: NodeType): node is NodeTypeCanHavePopover;
export declare function ensureIsPopoverRoot(node: NodeType): PopoverRootNode;
export declare function isNodeWithPopover(node: NodeType): node is NodeTypeWithPopover;
export declare function ensureIsNodeWithPopover(node: NodeType): NodeTypeWithPopover;
export declare function canNodeBeRootNode(node: NodeType): boolean;
export declare function isNodeRendered(node: NodeType): node is NodeTypeRenderable;
export declare function canNodeBeDuplicated(node: NodeType): node is NodeTypeRenderable;
export declare function canNodeBeWrappedWithStack(node: NodeType): node is NodeTypeRenderable;
export declare function canNodeBeUnwrapped(node: NodeType, parentNode: NodeTypeWithChildren | undefined): boolean;
/**
 * Sizing
 */
export declare function makeSizeDataWithParentDirection(size: SizeData, direction?: LayoutData["direction"]): SizeDataWithParentDirection;
export declare function getEvaluatedAxisSize(nodeId: NodeId, size: SizeData, nodes: NodeMap): SizeDataWithParentDirection;
/**
 * Extra selectors (ie editing built by subframe styles)
 */
export declare function addExtraSelectorsToDefinition(componentDefinition: ComponentDefinition, extraSelectors: SelectorsMap): ComponentDefinition;
export declare function getMergedSelector(selectors: Selectors, selectorId: string, deviceType: DeviceType): Selector;
export declare function getMergedSelectors(selectors: Selectors, deviceType: DeviceType): SelectorsMap;
export declare function getSelectorsForDeviceType(selectors: Selectors, deviceType: DeviceType): SelectorsMap;
export declare function getComponentWithMergedSelectors(component: ComponentDefinition): ComponentDefinition;
/**
 * Other
 */
export declare function shouldHideComponentFromAddMenu(componentId: string): boolean;
//# sourceMappingURL=data-helpers.d.ts.map