I'm aware that I can assign a generic to a tuple type based on the input value of a function, for example
declare function example<A extends [any,...any[]]>(a: A) : A
example([1,2,3,[4]]) // : [ number, number, number, number[] ]
However I'd like the literal values, like so
example([1,2,3,[4]]) // : [ 1, 2, 3, [4] ]
How can I achieve this?