class MyClass {
constructor() {}
aMethod() {}
anotherMethod() {}
aField = 'foo'
anotherField = 42
}
type MethodNamesMyClass = MethodNames<MyClass>
expectType<TypeEqual<MethodNamesMyClass, 'aMethod' |'anotherMethod'>>(true)
Original code from https://zirkelc.dev/posts/extract-class-methods
Extract the method key names from a class