I'm having an interface from a 3rd party library (A). I'm creating an alias bar
for a property foo
in my project. This works fine, but I also want my alias to inherit the DocBlock comment of the property.
interface A {
/**
* It's a number
*/
foo: number;
}
interface B extends A {
bar: A["foo"];
}
const x: B = {
foo: 1,
bar: 2
};
In Codesandbox you can try this using CTRL+Hover inside x
on foo
and bar
. foo
will have comments, bar
do not. I want bar
also to show the same DocBlock comment.
https://codesandbox.io/s/lucid-architecture-6ppe6?file=/src/index.ts