Really hitting my head against a wall on this one. I remember working in Angular that TS interfaces can be used to type hint parameters.
I'd like to do the same for props in Vue.
Any ideas? Code is as follows but the check is only made against a standard Object so passing in ANY object is valid:
import Vue from 'vue';
import Person from './../models/Person';
export default Vue.extend({
name: 'HelloWorld',
props: {
person: {
type: Object as () => Person
},
},
});
Interface as follows:
export default interface Person {
firstName: string;
lastName: string;
}