I need pass to function doSomething string or result of function, that returns string:
const someFunction = (href: string) => {
...
};
type a = () => string;
export function doSomething (href: string | a): void {
someFunction(href);
}
But I get an error:
Argument of type 'string | a' is not assignable to parameter of type 'string'. Type 'a' is not assignable to type 'string'.
Function of type a returns string, then why I get this error?
Thanks in advance.