嘿,TS中有以下可能吗?
interface MyInterface<T> {
${T}_function: (a: number): void;
${T}_prop: number;
}
MyClass implements MyInterface<'Example'> {
// TSLINT-GOD says:
// You need to implement:
// -> Example_prop of type number and
// -> Example_function with signature (a: number): void;
}
如果可能的话,用例如下:
MyClass implements MyInterface<'cat'>, MyInterface<'dog'> {
I know I have to implement 4 function with specific name.
}