-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ParamTypes issue #26
Comments
Yeah, makes sense. Would you like to make a PR? |
Sorry, have no time. That's my current scratch if smbd will) type Constructor<T = any, A extends any[] = any[]> = new (...args: A) => T;
type AnyFunction<R = any, A extends any[] = any[]> = (...args: A) => R;
type ArgTypes<F> =
F extends AnyFunction<any, infer T> ? T :
F extends Constructor<any, infer U> ? U :
F extends Function ? any[] : never;
type ArgCount<F> = ArgTypes<F> extends infer R
? (R extends any[] ? R["length"] : never)
: never; |
Welcome to the club 🙂 |
We're all here, but we can't stay to chat. No time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As I mentioned in microsoft/TypeScript#25660 (comment) and in microsoft/TypeScript#21316 (comment)
without inversed check you got wrong result
The text was updated successfully, but these errors were encountered: