/** * 通用 dataSource 解析, * Tree/Combo/Grid/PageList ... 都会从这里解析 */ export declare function dataSourceReload(ctl: any, extraParam?: any, _successCb?: Function, successCallback?: (data: any[]) => void, failCallback?: (msg: any) => void): Promise; export interface DataSourceParam { /** * 额外附加的参数 */ extraParam?: any; /** * 成功后额外的调用 */ _successCb?: Function; /** * 设置响应成功的数据 */ successCallback: (data: any[]) => void; /** * 设置响应失败 * @param msg 错误消息(可以为空) */ failCallback: (msg?: string) => void; } export interface DataSourceBefore extends DataSourceParam { /** * 取消下一步的请求 */ cancel: () => void; } /** * 方法作为数据源 */ export declare type DataSourceFunction = (sender: T, option: DataSourceParam) => void; /** * Ajax 数据源 */ export interface DataSourceAjax { url: string; method: string; params?: { [key: string]: (() => any) | any; }; } /** * Sql 数据源 */ export interface DataSourceSql { sqlId: string; db: string; params?: { [key: string]: (() => any) | any; }; } /** * 数据源配置 */ export declare type DataSourceHelper = DataSourceFunction | DataSourceAjax | DataSourceSql; /** * 数据抽取之前的设置 */ export declare type OnBeforeDataLoad = (sender: T, option: DataSourceBefore) => void; /** * 数据加载完成之后的回调 */ export declare type OnDataLoadComplete = (sender: T) => void;