#re-export type provided by typescript on imported `.json` object

5 messages · Page 1 of 1 (latest)

crude lodge
#

is it possible to access the type on the data object or do I have to manually re-declare type that aligns with it?

finite helm
#

try with typeof data["contacts"]

#

maybe also add [number] since it seems contacts is an array and you want to get the type the elements

crude lodge
#

that works, wasn't aware of that syntax, thanks!

#

!resolved