import { IFieldDependencyOptionType } from './field'; export declare type InternalNamePath = (string | number)[]; export declare type NamePath = string | number | InternalNamePath; export declare type CommonObject = Record; export declare type CommonTypes = string | number | CommonObject; export declare type OptionsTypes = { value: Exclude; label: Exclude; }; export declare type OutPutType = string | number | Record | IOptions[] | boolean; export declare type IFieldDependencyCtx = IFieldDependencyOptionType & { store: CommonObject; }; export interface IFieldKuFmDependency { /** 初始化不处理值关联防止覆盖的错误 */ type: 'visible' | 'options' | 'disabled' | 'value' | 'render' | string; /** 关联字段 */ relates: NamePath[] | ((groupsName: NamePath[]) => NamePath[]); /** 输出值(options 与 value才需要) */ output?: OutPutType | ((ctx: IFieldDependencyCtx, dependsValues: any[]) => Promise); /** 关联函数 不传默认为true */ relateFun?: (ctx: IFieldDependencyCtx, value: any[], name?: NamePath) => boolean | Promise; } export interface IFieldDependencyMap { dependency: IFieldKuFmDependency[]; names: NamePath[]; name: NamePath; } export interface IOptions { value: string | number | boolean; label: string; [key: string]: any; } export declare type GetValueByNamePath = P extends string ? T[P] : P extends (string | number)[] ? GetValueByPath : never; export declare type GetValueByPath, P extends readonly any[]> = P extends [] ? V : P extends [infer F, ...infer L] ? F extends keyof V ? GetValueByPath : never : never; export declare type ValuesInT = { [key in keyof T]: T[key]; }; export declare type EventArgs = any[];