Function app.component()

Registers a global component if passing both a
name string and a component definition, or
retrieves an already registered one if only the
name is passed.

interface App {
  component(name: string): Component | undefined
  component(name: string, component: Component): this
}
import { createApp } from 'vue'

const app = createApp({})

// register an options object
app.component('my-component', {
  /* ... */
})

// retrieve a registered component
const MyComponent = app.component('my-component')