Let\'s suppose there\'s a typing file for library X which includes some interfaces.
interface I1 {
x: any;
}
interface I2 {
y: {
a: I1,
An interface is like the definition of an object. Then y is a property of your I2 object, that is of a certain type, in that case "anonymous".
You could use another interface to define y and then use it as your y type like this
interface ytype {
a: I1;
b: I1;
c: I1;
}
interface I2 {
y: ytype;
z: any;
}
You can put your interface in a file and use extract so you can import it in other files of your projects
export interface ytype {
a: I1;
b: I1;
c: I1;
}
export interface I2 {
y: ytype;
z: any;
}
You can import it that way :
import {I1, I2, ytype} from 'your_file'