import type { App, Plugin } from 'vue'

import type { AnchorProps } from './Anchor'
import Anchor from './Anchor'
import type { AnchorLinkItemProps, AnchorLinkProps } from './AnchorLink'
import AnchorLink from './AnchorLink'

Anchor.Link = AnchorLink

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

export type { AnchorLinkItemProps, AnchorLinkProps, AnchorProps }
export { AnchorLink, AnchorLink as Link }

export default Anchor as typeof Anchor &
  Plugin & {
    readonly Link: typeof AnchorLink
  }
