#Expanding an array type into function parameters

1 messages · Page 1 of 1 (latest)

tawny perch
#

hi, suppose I have the following:

type foo = [string, string, string]
type bar = () => void
```how can I expand `foo` into `bar`'s call parameters?
sacred kraken
#

To clarify, you want bar to be:

type bar = (a: string, b: string, c: string)

?

boreal zealot
#
type foo = [string, string, string]
type bar = (...args: foo) => void
//   ^?
#

!ts

formal bobcatBOT
#
type foo = [string, string, string]
type bar = (...args: foo) => void
//   ^? - type bar = (args_0: string, args_1: string, args_2: string) => void
boreal zealot
#

@tawny perch

tawny perch
#

oh shoot

#

my bad

#

yeah that works, thanks

vague stag
#

!resolved