import { buildProps, definePropType } from '@kankan-components/utils'
import type { ExtractPropTypes, VNode } from 'vue'
import type floating from './floating.vue'

export const floatingProps = buildProps({
  mount: {
    type: definePropType<VNode>(Object),
    default: document.body,
  },
  class: {
    type: String,
    default: '',
  },
  refer: {
    type: Object,
  },
  dire: { type: String },
  width: {
    type: definePropType<number | string>([Number, String]),
  },
  height: {
    type: definePropType<number | string>([Number, String]),
  },
})

export type FloatingProps = ExtractPropTypes<typeof floatingProps>

export type FloatingInstance = InstanceType<typeof floating>
