-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Tuples as types for rest ...arguments #5331
Comments
Could you write up a bit longer explanation of how you'd want this to work? For example, if the declaration of |
@RyanCavanaugh, I suppose you meant this signature: |
Another use case for this is to properly declare the spread function. Something like this: interface Promise<T> {
spread<U>(fulfilledHandler: (...values: T & any[]) => U | Promise<U>): Promise<U>;
spread<U>(fulfilledHandler: (...values: [T]) => U | Promise<U>): Promise<U>;
} |
This feature could be used in observable-like generic classes/interfaces:
Currently the only way I know of is to fallback to
any
.The text was updated successfully, but these errors were encountered: