jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
17 lines (16 loc) • 957 B
TypeScript
import type { ReactNode } from 'react';
import type { ClassValue, SchemaNode } from 'jamis-core';
import type { SchemaCollection, SchemaObject } from '../types';
import type { RenderChildProps } from './types';
export declare function renderChildren(prefix: string, node: SchemaNode, props: RenderChildProps): ReactNode;
/**
* 格式化字符串/数组/单个schema/schema数组的复杂情况, 转换成统一的SchemaObject数组
* 提供了format钩子函数来格式化schema逻辑.
*/
export declare const formatSchemaCollection: (schema: SchemaCollection | undefined | null, format: {
/**
* 给每一项添加上样式类
*/
className?: ClassValue | ((item: SchemaObject, index: number, itemsCount: number) => ClassValue);
} | ((schema: SchemaObject, index: number, itemsCount: number) => SchemaObject)) => SchemaObject[];
export declare function renderChild(prefix: string, node: SchemaNode, props: RenderChildProps): ReactNode;