@fe6/water-pro
Version:
An enterprise-class UI design language and Vue-based implementation
29 lines (28 loc) • 1.35 kB
TypeScript
/** @format */
import type { TableProProps, FetchParams, SorterResult } from '../types/table';
import type { PaginationProps } from '../types/pagination';
import { ComputedRef, Ref } from 'vue';
interface ActionType {
getPaginationInfo: ComputedRef<boolean | PaginationProps>;
setPagination: (info: Partial<PaginationProps>) => void;
setLoading: (loading: boolean) => void;
getFieldsValue: () => Recordable;
clearSelectedRowKeys: () => void;
tableData: Ref<Recordable[]>;
}
export declare function useDataSource(propsRef: ComputedRef<TableProProps>, { getPaginationInfo, setPagination, setLoading, getFieldsValue, clearSelectedRowKeys, tableData, }: ActionType, emit: EmitType): {
getDataSourceRef: ComputedRef<{
[x: string]: any;
}[]>;
getDataSource: <T = Recordable<any>>() => T[];
getRowKey: ComputedRef<string | ((record: Recordable<any>) => string)>;
setTableData: <T_1 = Recordable<any>>(values: T_1[]) => void;
getAutoCreateKey: ComputedRef<boolean>;
fetch: (opt?: FetchParams) => void;
reload: (opt?: FetchParams) => Promise<void>;
updateTableData: (index: number, key: string, value: any) => Promise<{
[x: string]: any;
}>;
handleTableChange: (pagination: PaginationProps, filters: Partial<Recordable<string[]>>, sorter: SorterResult) => void;
};
export {};