import type { App, Plugin } from 'vue'

import type { SizeType as FloatButtonSize } from '../config-provider'
import BackTop from './BackTop'
import FloatButton from './FloatButton'
import FloatButtonGroup from './FloatButtonGroup'
import type {
  BackTopProps,
  FloatButtonGroupProps,
  FloatButtonProps,
  FloatButtonShape,
  FloatButtonType,
} from './interface'

export type {
  BackTopProps,
  FloatButtonGroupProps,
  FloatButtonProps,
  FloatButtonShape,
  FloatButtonSize,
  FloatButtonType,
}

FloatButton.Group = FloatButtonGroup
FloatButton.BackTop = BackTop

/* istanbul ignore next */
FloatButton.install = function (app: App) {
  app.component(FloatButton.name, FloatButton)
  app.component(FloatButtonGroup.name, FloatButtonGroup)
  app.component(BackTop.name, BackTop)
  return app
}

export { BackTop, FloatButtonGroup }

export default FloatButton as typeof FloatButton &
  Plugin & {
    readonly Group: typeof FloatButtonGroup
    readonly BackTop: typeof BackTop
  }
