You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the lib infers the TS type in get/watch from the JSON schema for simple types (string, number, boolean and array of the former), but not for complex arrays or objects, leading to:
a double work for the user, who must do the type and the JSON schema
we are not sure the type match the JSON schema
It is now possible with today's TypeScript to infer the type from the JSON schema even for complex types.
Note it requires to assert JSON schemas as const (maybe microsoft/TypeScript#30680 could help, but it doesn't seem it will get a solution from TS).
The text was updated successfully, but these errors were encountered:
Blocked on Angular supporting TS 4.1 (and TS >= 4.1 only) for recursive conditional types, so probably not before Angular v12.
Also, a DX issue (no IntelliSense when writing the JSON schemas) is discussed in microsoft/TypeScript#41247, but it doesn't seem it will get a solution from TS.
Description of the issue
Currently the lib infers the TS type in
get
/watch
from the JSON schema for simple types (string
,number
,boolean
and array of the former), but not for complex arrays or objects, leading to:It is now possible with today's TypeScript to infer the type from the JSON schema even for complex types.
Note it requires to assert JSON schemas
as const
(maybe microsoft/TypeScript#30680 could help, but it doesn't seem it will get a solution from TS).The text was updated successfully, but these errors were encountered: