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
There are many scenarios where complex type hierarchies (interfaces/classes) are needed, for example when typing the response of an API or the options object of a JavaScript library. But it can be quite cumbersome to define each segment/sub-type in such a hierarchy separately in order to use it as a type elsewhere.
It is already possible to use the type of any nested property of an instance for typing:
In this case it would be nice to have and save a lot of code if the interface has a very deep hierarchy. But it's even more important for type hierarchies declared in external definition files. See for example the Options interface defined for handsontable:
Looks like a duplicate of #4555, which was closed in favour of #4640 which was closed in favour of #6606.
Although the proposal in #6606 addresses this issue, the guidance from the team about what PR would be accepted does not cover it. Perhaps someone from the team can clarify whether anything has changed in terms of supporting this.
There are many scenarios where complex type hierarchies (interfaces/classes) are needed, for example when typing the response of an API or the options object of a JavaScript library. But it can be quite cumbersome to define each segment/sub-type in such a hierarchy separately in order to use it as a type elsewhere.
It is already possible to use the type of any nested property of an instance for typing:
But it would be convenient to do that without the need of an instance:
In this case it would be nice to have and save a lot of code if the interface has a very deep hierarchy. But it's even more important for type hierarchies declared in external definition files. See for example the Options interface defined for handsontable:
None of these callbacks are defined separately, so it would be great to be able to use them directly with
const cb: Options.afterAutofillApplyValues;
.(This may well have been proposed before, but I couldn't find anything in the current issue list.)
The text was updated successfully, but these errors were encountered: