declare namespace NaiveUI { type ThemeColor = 'default' | 'error' | 'primary' | 'info' | 'success' | 'warning'; type Align = 'stretch' | 'baseline' | 'start' | 'end' | 'center' | 'flex-end' | 'flex-start'; type DataTableBaseColumn = import('naive-ui').DataTableBaseColumn; type DataTableExpandColumn = import('naive-ui').DataTableExpandColumn; type DataTableSelectionColumn = import('naive-ui').DataTableSelectionColumn; type TableColumnGroup = import('naive-ui/es/data-table/src/interface').TableColumnGroup; type PaginationProps = import('naive-ui').PaginationProps; type TableColumnCheck = import('@sa/hooks').TableColumnCheck; type TableDataWithIndex = import('@sa/hooks').TableDataWithIndex; type FlatResponseData = import('@sa/axios').FlatResponseData; /** * the custom column key * * if you want to add a custom column, you should add a key to this type */ type CustomColumnKey = 'operate'; type SetTableColumnKey = Omit & { key: keyof T | CustomColumnKey }; type TableData = Api.Common.CommonRecord; type TableColumnWithKey = SetTableColumnKey, T> | SetTableColumnKey, T>; type TableColumn = TableColumnWithKey | DataTableSelectionColumn | DataTableExpandColumn; type TableApiFn = ( params: R ) => Promise>>; /** * the type of table operation * * - add: add table item * - edit: edit table item */ type TableOperateType = 'add' | 'edit'; type GetTableData = A extends TableApiFn ? T : never; type NaiveTableConfig = Pick< import('@sa/hooks').TableConfig, TableColumn>>>, 'apiFn' | 'apiParams' | 'columns' | 'immediate' | 'searchParams' > & { /** * whether to display the total items count * * @default false */ showTotal?: boolean; }; type CodeMirrorLang = 'js' | 'json'; }