import { createTypes } from 'vue-types'
import type { VueTypeValidableDef, VueTypesInterface } from 'vue-types'
import * as CSS from 'csstype'
import type { VNodeChildren } from 'vue'

interface CssProperties extends CSS.Properties<string | number>, CSS.PropertiesHyphen<string | number> {}

const PropTypes = createTypes({
  func: undefined,
  bool: undefined,
  string: undefined,
  number: undefined,
  array: undefined,
  object: undefined,
  integer: undefined,
})

PropTypes.extend([
  {
    name: 'looseBool',
    getter: true,
    type: Boolean,
    default: undefined,
  },
  {
    name: 'style',
    getter: true,
    type: [String, Object],
    default: undefined,
  },
  {
    name: 'VNodeChild',
    getter: true,
    default: undefined,
  },
])

type IPropTypes = VueTypesInterface & {
  readonly looseBool: VueTypeValidableDef<boolean>
  readonly style: VueTypeValidableDef<CssProperties>
  readonly VNodeChild: VueTypeValidableDef<VNodeChildren>
}

export default PropTypes as IPropTypes
