TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
sheetalkamat on watchOptions
sheetalkamat on master
Add watchOptions to tsconfig an… (compare)
?
denotes the existential type, ? extends ?
is true
? = ?
(assignment) is not allowed
...args: any[]
since the rest param always has to be an array
any
being assignable to any[]
and the other way around. So it doesn't matter
any[]
, though
ReturnType<>
should be accepting a top type for functions, anyway
F
will still end up having never
in the param and will break ReturnType<>
=x
Function
as the top type for functions
interface Mx {
v: string;
}
const promiseTuple = async <T1, T2>(t1: T1, t2: Promise<T2>): Promise<[T1, T2]> =>
[t1, await t2];
const doThings = async (): Promise<Array<[string, Mx[]]>> => Promise.all([
promiseTuple('hello', Promise.resolve([{ v: 'sunshine' }])),
promiseTuple('world', await [{ v: 'peace' }])
]);
doThings().then(r => r.forEach(console.log));