<script lang="ts">
import Vue, { PropType } from 'vue'

interface Book {
  title: string
  author: string
  year: number
}

const Component = Vue.extend({
  props: {
    book: {
      type: Object as PropType<Book>,
      required: true,
      validator (book: Book) {
        return !!book.title;
      }
    }
  }
})
</script>