Typescript Object Property Type Function In Javascript With Parameters