/** * @file 给普通组件提供的基础类,基础函数 * @author dongtiancheng */ import { BasicConfig, BasicContainerPropsInterface, BasicContainerSetDataOptions, RCREContextType } from '../../types'; import React from 'react'; import { gridPositionItems } from '../Layout/Row/Row'; export declare type rawJSONType = string | number | null | boolean | Object; export declare type originJSONType = rawJSONType | rawJSONType[]; export declare type defaultData = { [s: string]: originJSONType; }; export declare class GridItem { gridCount?: number; gridPosition?: gridPositionItems; gridPaddingLeft?: number; gridPaddingRight?: number; gridLeft?: number; gridTop?: number; gridWidth?: number | string; gridHeight?: number | string; } /** * 获取ExpressionString 嵌入的上下文 * @param {BasicContainerPropsInterface} props * @param context * @return {runTimeType} */ export declare type ParseInfoOptions = { props?: T; context?: RCREContextType; blackList?: string[]; isDeep?: boolean; whiteList?: string[]; }; /** * 所有子级组件的基类 */ export declare abstract class BasicContainer extends React.Component { static contextType: any; isUnMounted: boolean; TEST_INFO: any; constructor(props: T); componentWillUnmount(): void; shouldComponentUpdate(nextProps: T, nextState: P): boolean; /** * 获取当前组件的ExpressionString 内嵌变量 * * @param {T} props React组件的Props * @param context React组件Context * @returns {runTimeType} */ getRuntimeContext(props?: T, context?: any): import("../../types").RunTimeType; /** * 是否组件已经从container获取了值 * @returns {boolean} */ isReady(props?: T): boolean; /** * 在Connect组件上清除不需要传递到RCRE之外的属性 */ muteParentInfo(mute: any): any; /** * 转换带有~的内部属性 * @param {Q} config * @returns {Q} */ transformInnerProperty(config: any): any; /** * 调用此函数来解析JSON配置中的ExpressionString指令 * @deprecated * @param {InfoType} info 组件的JSON配置 * @param {T} props React组件的Props * @param {string[]} blackList 属性黑名单,指定之后不处理ExpressionString * @param {boolean} isDeep 是否深度遍历JSON配置 * @param {string[]} whiteList 属性白名单,如果指定之后,只处理白名单里面的属性值 * @param {object} context 组件上下文 * @returns {InfoType} */ protected getPropsInfo(info: InfoType, props?: T, blackList?: string[], isDeep?: boolean, whiteList?: string[], context?: any): InfoType; /** * 调用此函数来解析JSON配置中的ExpressionString指令 * * @param {InfoType} info * @param {ParseInfoOptions} options * @return */ getParsedInfo(info: InfoType, options?: ParseInfoOptions): InfoType; /** * 渲染组件,用于支持hidden属性,可让组件隐藏 * * @param {BasicConfig} info 组件的JSON配置 * @param {React.ReactElement} children 输出的React组件 * @returns {any} */ renderChildren(info: BasicConfig, children: React.ReactNode): {} | null | undefined; /** * 事件注册器,注册一个事件,可以使用trigger属性来调用 * * @param {string} eventName 事件名称 * @param {any} args 额外的参数,会注入到param属性中的$args对象 * @param {object} options 特殊参数 */ commonEventHandler(eventName: string, args: { [s: string]: any; }, options?: object): Promise; /** * 使用Key,获取当前组件在container中的值 * * @param {string} nameStr * @param {BasicConfig} info * @param {BasicContainerPropsInterface} props * @param {boolean} isTmp 从TMP_STORE中获取数据 * @returns {any} */ getValueFromDataStore(nameStr?: string | number, props?: T, info?: BasicConfig, isTmp?: boolean): any | null; /** * 同步值到Container组件 * @param {string} key 同步到Container的key * @param {any} value 同步到Container的值 * @param {BasicContainerPropsInterface} props 当前环境下的props * @param {BasicContainerSetDataOptions} options 额外的配置项 * @return {void} */ setData(key: string, value: any, props?: T, options?: BasicContainerSetDataOptions): void; /** * 组件是否处于container组件内部 * @returns {boolean} */ isUnderContainerEnv(): boolean; /** * * @returns {boolean} */ isDebugMode(): boolean; isRCREConfig(config: any): any; }