import type { R } from '@/common/utils/http-util.ts'

/* export interface SearchForm extends Record<string, any> {
 keywords?: string
 }

 export interface AddForm extends Record<string, any> {
 }

 export interface ModifyForm extends Record<string, any> {
 id: string
 }

 export interface Data extends Record<string, any> {
 id: string
 } */

export interface DataSource<D extends Record<string, any>, S extends G.PageParam> {
  paging: (searchForm: S) => Promise<G.PageResult<D>>
  del: (ids: string[]) => Promise<R>
  detail: (id: string) => Promise<R<D>>
  add: (addForm: Record<string, any>) => Promise<R>
  modify: (modifyForm: Record<string, any>) => Promise<R>
  treeLoad?: (row: D, treeNode: unknown, resolve: (data: D[]) => void) => void
}

export interface Column {
  prop: string
  label: string
  width?: string
}
