import { DragObjectWithTypeWithTarget as BaseDragObjectWithTypeWithTarget } from "./components/Droppable"; import { PbBlockVariable, PbEditorElement, PbEditorElementTree, PbEditorPageElementPlugin, PbElement } from "../types"; export declare const getNanoid: (size?: number | undefined) => string; interface FlatElements { [id: string]: PbEditorElement; } export declare const flattenElements: (el?: PbEditorElementTree | PbEditorElement, parent?: string) => FlatElements; interface CreateElementCallableOptions { [key: string]: any; } interface CreateElementCallable { (type: string, options?: CreateElementCallableOptions, parent?: PbEditorElement): PbEditorElement; } export declare const createElement: CreateElementCallable; export declare const addElementToParent: (element: PbEditorElement, parent: PbEditorElement, position?: number) => PbEditorElement; export declare const removeElementFromParent: (parent: PbEditorElement, id?: string) => PbEditorElement; export interface DragObjectWithTypeWithTarget extends BaseDragObjectWithTypeWithTarget { elements?: PbEditorElement[]; data?: Record; } export declare const createDroppedElement: (source: DragObjectWithTypeWithTarget, target: PbEditorElement) => PbEditorElement; /** * Traverse elements and generate valid element IDs and `variableId` references. */ export declare function prefixElementIdsRecursively(elements: PbEditorElement[], id: string): PbEditorElement[]; /** * Update all block element variable IDs with the given `blockId` prefix. */ export declare function generateBlockVariableIds(variables: PbBlockVariable[], blockId: string): { id: string; type: string; label: string; value: any; }[]; /** * Add unique id to elements recursively */ export declare const addElementId: (target: Omit) => PbEditorElement; /** * Remove id from elements recursively */ export declare const removeElementId: (el: PbElement) => PbElement; export declare const createBlockElements: (name?: string) => PbEditorElement; export declare const userElementSettingsPlugins: (elementType: string) => string[]; export declare const userElementStyleSettingsPlugins: (elementType: string) => string[]; type CreateEmptyElementCallableType = (args: Pick) => PbEditorElement; export declare const createEmptyElement: CreateEmptyElementCallableType; export interface UpdateBlockPositionParams { parent: PbEditorElement; sourcePosition: number; targetPosition: number; } export declare const updateBlockPosition: (params: UpdateBlockPositionParams) => PbEditorElement; export declare const moveInPlace: (arr: PbEditorElement[], from: number, to: number) => PbEditorElement[]; export declare const onReceived: PbEditorPageElementPlugin["onReceived"]; export {};