Closed keyiis closed 2 years ago
TS does support overloads, but they have to share a single implementation: https://www.typescriptlang.org/docs/handbook/2/functions.html#function-overloads
What you wrote is not valid TS.
@fatcerberus Thanks reply! I have seen this document, But it doesn't seem to meet my needs, the ClassA
extend EventEmitter, In fact, I don't need to implement the on
method, But I hope there will be specific hints for specific events,so i have to be able to define these special tips somewhere.
@fatcerberus Thank you very much for your help!
If there are multiple methods with the same name but different parameters in a class, their comments are also different, which cannot be implemented in typescript at present. Example: