When working with objects, I utilize the spread/rest operator to destructure an object literal.
Is there a way to add type annotation specifically to the rest part?
I attempted to accomplish this task, but encountered an error when running tsc
.
const { x, y, ...rest }: {x: number, y: number, ...rest: any} = { x: 1, y: 2, z: 3, q: 4 };