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
Post a Comment