Loading...
function greet(this: User) {
return this.name;
}
type Ctx = Parameters<typeof greet>[0];function greet(this: User) {
return this.name;
}
type Ctx = ThisParameterType<typeof greet>; // UserParameters ignores the fake this parameter; ThisParameterType reads it directly.
Parameters<typeof fn>[0] and expecting the this type, which Parameters skips.this as its first fake parameter, e.g. function f(this: Window).unknown, the result for functions with no this parameter.No, Parameters<T> returns only the real arguments. Use ThisParameterType<T> to get the this type.
It returns unknown.