How can I inform typescript that I will be utilizing an interface containing a function called "foo" which always returns a string. The implementation of the function will be specified by the object implementing the interface.
For example:
export interface IMyInterface {
foo: ():string => void;
}
The issue is that the compiler is showing an error when including :string
in the code.
What would be the correct syntax to avoid getting a return type of "any" if :string
is removed?