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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -