Is it possible to incorporate an "interface subtype" into a component, such as this:
@Component
export default class Graph extends Vue
{
@Prop ()
public data: Array<Graph.Data> ;
}
which includes a sub-interface like:
export interface Data
{
time: Date
value: number
}
to ensure that the caller provides correctly formatted props:
<graph :data="data" />
where data
must be of type Array<Graph.Data>
.
Any suggestions or thoughts on how to achieve this?