import type { CSSProperties, ExtractPropTypes, InjectionKey } from 'vue'

import type { PropType } from 'vue'

export const tableProps = {
  data: [],
}

export type TableProps = ExtractPropTypes<typeof tableProps>

export type TableProvide = {
  props: Omit<TableProps, 'index' | 'customStyle' | 'customClass'>
  state: {
    scrollLeft: number
  }
  rowClick: (index: number) => void
  getIsLastFixed: (column: { fixed: boolean; prop: string }) => boolean
  getFixedStyle: (index: number, style: CSSProperties) => CSSProperties
}

export const TABLE_KEY: InjectionKey<TableProvide> = Symbol('wd-table')
