Resolved<P>
says "if this is a promise, the type here is whatever the promise resolves to; otherwise, it's just the value"ReturnType<T>
gets the return value of a given functionR['model']
(where R
has to be Route
itself or a subclass) uses TS's mapped types to say "the property named model
on R
ModelFrom<Route>
ends up giving you the resolved value returned from the model
hook for a given route:model
on the controllermodel
on a Controller
is always exactly the type returned by Route::model
by writing something like this:model
property will always stay in sync with the corresponding route’s model hook.model
in either the afterModel
or setupController
hooks on the route! That's generally considered to be a bad practice anyway. If you do change the type there, you'll need to define the type in some other way and make sure your route's model is defined another way.