import React, { FC, FunctionComponent, ForwardRefExoticComponent } from 'react'; export interface PanelContentProps { children: React.ReactElement; extendProps: Record; uploadChannelProps: (props: Record, key: string) => void; } export interface ChannelContainerOptions { uploadChannelProps: (props: Record, key: string) => void; getProps: (c: React.ReactElement) => any; } export interface ChannelContainerProps { children: (options: ChannelContainerOptions) => React.ReactElement; } /** * 包裹子组件,可以给子组件传递额外的数据,也可以监听属性值变化 * @param props * @returns */ declare const Item: FC; export interface useRuntimePropsType { (props: Record, keyPath: string[], uploadChannelProps: (props: Record) => void): void; } /** * 实时上报数据给父节点 配合RuntimeContainer使用 * 可自定义配置属性,可自定义props内容。 * 自动根据keyPath取props的值,并上报keyPath到RuntimeContainer, * 不可与withRuntimeItem同时使用 * @param props 字段对应的数据值 * @param depthKey 需要上报的字段 */ declare const useChannelProps: useRuntimePropsType; /** * 实时上报数据给父节点 配合RuntimeContainer使用 * 针对上报静态属性,可以通过高阶函数的方式包裹子组件,并配置需要上报的属性 * 自动根据keyPath取props的值,并上报keyPath到RuntimeContainer * 不可与withRuntimeItem同时使用 * @param Component 子组件 * @param options * @returns */ declare function withChannelItem>(Component: FunctionComponent | ForwardRefExoticComponent, options: { keyPath: string[]; }): React.ForwardRefExoticComponent & React.RefAttributes>; declare const ChannelContainer: React.FC & { Item: typeof Item; useChannelProps: typeof useChannelProps; withChannelItem: typeof withChannelItem; }; export default ChannelContainer;