import { DSLQuery } from '@lingxiteam/dsl'; import { LcdpEditorContextValue } from '../utils/EditContext'; import { DataSourceItemType } from '@lingxiteam/dsl/lib/core/PropType'; /** * String 字符串 * Function 使用方法返回值 * Select 下拉选项目值, 需要执行option key 或者 自定义数据源 (customOption) */ export declare type configTypeStr = 'String' | 'Function' | 'Select' | 'FromOption' | 'FromNode' | 'fetchListFunc'; export declare const configType: Record; /** * 类属性props */ interface ActionDescInstanceProps { DSLCore: DSLQuery; getEditorContext: () => LcdpEditorContextValue; isMobile: boolean; } /** * 通用方法 */ interface funcProps { DSLCore: DSLQuery; dataConfig: any; getEditorContext: () => LcdpEditorContextValue; isMobile: boolean; fetchList: any; } interface customOptionItem { title: string; value: string | number; } /** * 规则属性 */ export interface ruleConfig { type: configTypeStr; value?: string; format?: string | ((str: string) => string); compIdPath?: string; customOption?: customOptionItem[]; customFunc?: (args: funcProps) => string; optionKey?: string; api?: string; listKey?: string; associationKey?: string; } export interface config { rules: ruleConfig[] | ruleConfig; } /** * 配置数据类型检查 * @param value 配置数据 * @returns */ export declare const dataTypeCheck: (value?: string) => { isUrl: boolean; isDataSource: boolean; }; /** * 从数据源配置值中查找数据源项 * @param DSLCore DSLCore * @param value 数据源配置值 $data.xxxxx.xxxx$ * @returns */ export declare const getDataSourceFromValue: (DSLCore: DSLQuery, value: string, globalDataSource: any[]) => DataSourceItemType | undefined; export declare const findAttrInDataSourceItem: (dataSourceItem: DataSourceItemType, attrId: string) => any; export declare class ActionDescInstance { private DSLCore; private getEditorContext; private actionDescMap; private fetchList; private currentDataInfo; isMobile: boolean; constructor(props: ActionDescInstanceProps); unmount(): void; private getFuncProps; /** * 处理规则获取格式化字符串 * @param rule 规则 * @returns */ private handleRule; /** * 条件处理 */ private handleConditionData; /** * 是否存在自定义翻译配置 * @param dataInfo 动作信息 */ includeConfig(dataInfo: any): boolean; /** * 获取描述值 * @param dataInfo 事件动作值 * @returns */ getDesc(dataInfo: any): Promise; /** * 动作名称 * @param dataInfo 动作数据 * @returns */ getActionLabel(dataInfo: any): string; } export declare const getDescInstance: (props?: any) => ActionDescInstance; export {};