import { IPage } from '../blocks'; import { ReactElement } from 'react'; export interface IBlock { name: string; type: string; create: (payload?: RecursivePartial) => T; validParentType: string[]; render?: (data: T, idx: string | null, mode: 'testing' | 'production', context?: IPage, dataSource?: { [key: string]: any; }) => IBlockData | ReactElement | null; } export interface IBlockData { title?: string; type: string; data: { value: T; hidden?: boolean | string; }; attributes: K & { 'css-class'?: string; }; children: IBlockData[]; } export interface create { (payload?: RecursivePartial): T; } export declare type RecursivePartial = { [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial[] : T[P] extends object ? RecursivePartial : T[P]; };