@dndbuilder.com/react
Version:
Drag and drop builder for React
25 lines (24 loc) • 975 B
TypeScript
import { Block, BlockMeta, BlockProps } from '../types/block';
/**
* Generates props for a block component
* @param options - The options for generating block props
* @param options.block - The block to generate props for
* @param options.index - The index of the block
* @param options.isEditable - Whether the block is editable
* @param options.meta - Additional metadata for the block
* @returns The generated block props
*/
export declare const generateBlockProps: ({ block, index, isEditable, meta, }: {
block: Block;
index: number;
isEditable?: boolean;
meta?: BlockMeta;
}) => BlockProps;
/**
* Recursively generates a tree structure from flat block data
* @param root - The ID of the root block
* @param data - A record of blocks indexed by their IDs
* @returns A tree structure of blocks
*/
export declare const generateBlockTree: (root: string, data: Record<string, Block>) => Record<string, Block>;
//# sourceMappingURL=block.d.ts.map