typescript2.0 - Typescript interface issue ( anonymous and named function) -


i adding anonymous , named function in same ts interface facing issue while implementing anonymous function in class. checked typescript documentation did not find help. following class not compile , throw error "type 'classdecoding' provides no match signature '(n: string, age: number): string'' at: '1,14' source: 'ts' "

  export interface iclassdecoding{           functionwithname(name:string):string;           (n:string,age:number):string;      }     export class classdecoding  implements iclassdecoding{         af:(n:string,age:number) => string = (a,b) => "some text";          functionwithname(d:string){             return "some result";         }      } 


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -