import { PropType } from 'vue'
import { VxeUI } from '@vxe-ui/core'
import { tableComponenProps } from '../../table/src/props'

import type { VxeGridPropTypes } from '../../../types'

const { getConfig } = VxeUI

export const gridComponeProps = {
  ...tableComponenProps,
  layouts: Array as PropType<VxeGridPropTypes.Layouts>,
  columns: Array as PropType<VxeGridPropTypes.Columns<any>>,
  pagerConfig: Object as PropType<VxeGridPropTypes.PagerConfig>,
  proxyConfig: Object as PropType<VxeGridPropTypes.ProxyConfig<any>>,
  toolbarConfig: Object as PropType<VxeGridPropTypes.ToolbarConfig>,
  formConfig: Object as PropType<VxeGridPropTypes.FormConfig>,
  zoomConfig: Object as PropType<VxeGridPropTypes.ZoomConfig>,
  size: {
    type: String as PropType<VxeGridPropTypes.Size>,
    default: () => getConfig().grid.size || getConfig().size
  }
}
