I have the following function:
async function get(url: string): Promise {
return getUrl(url);
}
However, i
You could use multiple type parameters:
function contractType(value: unknown): U {
return value as U
}
const example1: string = contractType(17) // error
const example2: string = contractType("value") // error
const example3: string = contractType("value") // ok
https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-288902999