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 doesn't work:namespacen1{exporttypeJson=null|string|number|boolean|Json[]|Record<string,Json>;}// But this *does* work:namespacen2{exporttypeJson=null|string|number|boolean|Json[]|{[key: string]: Json};}
We can allow explicit object types, mapped types, or type references to classes/interfaces.
We do not have any special handling for instantiations of type aliases to object types or mapped types.
Have a prototype that makes some of this work.
Enables some patterns like
typeFunc<T>=()=>T;typeRecursiveFunc=Func<RecursiveFunc>;declarevarrf: RecursiveFunc;rf=rf()()()()()();// works
So what we do is that the type references themselves become deferred.
But this is tricky because now there is a concept of a type reference that resolves to a type alias in a deferred way, and that makes things a bit more opaque, harder to reason about.
What currently gets a deferred reference node?
type MyArray = Array<Blah>
type Blah = Array<Blah>
If we're instantiating a type alias that's an anonymous type or a mapped type, we can now do something very similar.
However, that adds that layer of indirection which means you have to resolve the type in certain locations.
Object types provide a natural deferral point because property types can be deferred; but generic homomorphic mapped types can expand out into a union. So how is that handled?
import declarations in a declare global don't implicitly get exported.
As I posted in #57019 (comment), since declare global { namespace globalThis { ... } } will have the same effect as declare global { ... }, and the former allow importing/exporting namespace alias inside it, I think it could be a good solution.
Exposing
TypeChecker#resolveName
#56932
getSymbolAtLocation
instead of this.SymbolFlags.All
.-1
/~0
?Supporting more recursive type aliases
#35017
#35164
#41164
#57034
We can allow explicit object types, mapped types, or type references to classes/interfaces.
We do not have any special handling for instantiations of type aliases to object types or mapped types.
Have a prototype that makes some of this work.
Enables some patterns like
So what we do is that the type references themselves become deferred.
What currently gets a deferred reference node?
type MyArray = Array<Blah>
type Blah = Array<Blah>
If we're instantiating a type alias that's an anonymous type or a mapped type, we can now do something very similar.
Object types provide a natural deferral point because property types can be deferred; but generic homomorphic mapped types can expand out into a union. So how is that handled?
Creating a Global Reference to a Module
#57019
import
declarations in adeclare global
don't implicitly get exported.export
it.export as namespace
?A
/** @nonnull */
tag#57042
@nonnull
tag"?/** @type */
to cast, but no non-null assertion.The text was updated successfully, but these errors were encountered: