The implementation of ISongServer required explicitly defined types for call and callback parameters. This seems to be the case if you create a class implementing the interface. TypeScript cannot detect the correct parameter types, and so they have to be declared.
Instead, if you directly implement the interface with an object, TypeScript will infer all of the function types. So now you don't have to declare any parameter types. Here I just returned it from a function for simplicity.
The implementation of
ISongServer
required explicitly defined types forcall
andcallback
parameters. This seems to be the case if you create a class implementing the interface. TypeScript cannot detect the correct parameter types, and so they have to be declared.Instead, if you directly implement the interface with an object, TypeScript will infer all of the function types. So now you don't have to declare any parameter types. Here I just returned it from a function for simplicity.