function foo(a: number, b: number) {
return a + b;
}
type Foo1 = typeof foo extends (...args: unknown[]) => unknown ? true : false; // false
type Foo2 = typeof foo extends (...args: any[]) => unknown ? true : false; // true
Why does it works with any[], but does not with unknown[]?
It works with tuples and ReturnTypes, but not with rest parameters.
type Foo = ['bar', 'baz'] extends unknown[] ? true : false; // true