How do I create and export a new interface – UIInterface: (would like to combine SummaryInterface with few other new properties)
Example:
JavaScript
x
2
1
import { SummaryInterface } from 'x-api'; // summaryInterface has 20+ properties defined and is auto-generated from script
2
My attempt
JavaScript
1
6
1
export interface UIInterface {
2
SummaryInterface &
3
{ displayStatus: string;
4
flag: boolean };
5
}
6
Advertisement
Answer
By extending the other interface like so:
JavaScript
1
5
1
export interface UIInterface extends SummaryInterface {
2
displayStatus: string;
3
flag: boolean;
4
}
5