ts-morph icon indicating copy to clipboard operation
ts-morph copied to clipboard

How to get `PropertyDeclaration`'s from `extends`.

Open Hugos68 opened this issue 10 months ago • 0 comments

Let's say I have:

interface InterfaceOne {
	propertyOne: string
}

interface InterfaceTwo extends InterfaceOne {
	propertyTwo: string
}
const interface = sourceFile.getInterface("interfaceTwo")

console.log(interface.getProperties().length) // 1

How can I get all properties, including those that are extended from? Use case: We're building automated documentation and need to extract all properties (including extended one's) to document them.

Hugos68 avatar Mar 07 '25 14:03 Hugos68