Using Typescript Interface Function