kevinmcisaac
Posts: 37
Joined: Mon Oct 05, 2020 8:27 am

Using a model as a Type in my typescript

I've defined a number of models and they seem to be used like a Type when the code is being tested.

Can I use them as a Type in my own custom Typescript? I tried using syntax like "function (latlon: LatLon): LogEntry {} "

where LatLon and LogEntry are models, but this did not work

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Re: Using a model as a Type in my typescript

Hello Kevin,

Sorry, I don't think this is a correct declaration of the function. You can pass "any" type as a function parameter instead of the specific type

Return to “Issues”