How can I achieve to assign the type of another property?
// 3rd party interface
interface A {
foo: FooType
}
// my desired solution
interface B extends A {
bar: typeof A.foo
}
How can I achieve to assign the type of another property?
// 3rd party interface
interface A {
foo: FooType
}
// my desired solution
interface B extends A {
bar: typeof A.foo
}
Use square bracket notation: A['foo']
// 3rd party interface
interface A {
foo: FooType
}
// my desired solution
interface B extends A {
bar: A['foo'] // here is the solution
}