**Edit:** Remove indexing part **Edit 2:** Replace tuple mapping syntax with [normal mapped types](https://github.com/Microsoft/TypeScript/pull/26063) ## Search Terms <!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily --> Concatentate and merge tuples' entries. ## Suggestion <!-- A summary of what you'd like to see added or changed --> 1. I would like to be able to extract and spread in positions other than the last part of a tuple. 1. I would like to merge a tuple into an intersection or concatenation of its members. ## Use Cases <!-- What do you want to use this for? What shortcomings exist with current approaches? --> - Converting a tuple to its intersection, such as with `Object.assign`'s assignee. - Typing `Array.prototype.concat` correctly for tuples. ## Syntax The syntax comes in a few new forms: - `[...A, B]` appends `B` to the tuple `A`. Similarly, `[...infer A, any] extends B ? A : []` drops the last item of the tuple and `[...any[], infer A] extends B ? A : never` extracts the first. - `{... ...T}` for an n-ary merge and `[... ...T]` an n-ary concatenation. ## Examples Here's the types for each method I mentioned above. ```ts interface Array<T> { concat<U extends any[]>(...others: U): [...this, ... ...{[I in keyof U]: ( U[I] extends any[] ? N : U[I] extends ArrayLike<infer R> ? R[] : [U[I]] )}]; } interface ObjectConstructor { assign(target: {... ...typeof sources}, ...sources: object[]): typeof target; } ``` <!-- Show how this would be used and what the behavior would be --> ## Checklist My suggestion meets these guidelines: * [x] This wouldn't be a breaking change in existing TypeScript / JavaScript code * [x] This wouldn't change the runtime behavior of existing JavaScript code * [x] This could be implemented without emitting different JS based on the types of the expressions * [x] This isn't a runtime feature (e.g. new expression-level syntax)