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
It's a pitfall to expose both the typeParameters property and getEffectiveTypeParameterDeclarations.
The name is clunky.
Ideally we would have either
A single function named getTypeParameters so Klaus Meinhardt (@ajafff) doesn't even have to write it.
The parser or some other component would produce a facade for js type aliases that actually has a type parameters property, plus a pointer back to the original.
Non-ideally, we would
3. Expose getEffecitveTypeParmaeterDeclarations.
(1) would break existing users of the typeParameters property. (2) might or might not be feasible. I lean toward (3) but I'm not sure how bad the break of (1) is.
changed the title [-]API: Property 'typeParameters' does not exist on type 'DeclarationWithTypeParameters'.[/-][+]API: expose getEffectiveTypeParameterDeclarations[/+]on Jun 4, 2018
Now that #24600 added more logic to getEffectiveTypeParameterDeclarations, I'm even more in the need of a public API for that purpose. I don't want to duplicate all that code.
Nathan Shively-Sanders (@sandersn) any chance this will make it into the 3.0.0 release? Otherwise I will probably rebuild that logic as part of my library tsutils.
Activity
mhegazy commentedon May 18, 2018
It does have type parameters, it is just not on
typeParameters, it is somewhere in the same JSDoc comment..Can you filter out
JSDocTypedefTagin your usage?ajafff commentedon May 18, 2018
I initially reported it because it seemed unintuitive and maybe unintentional.
Filtering out the JSDoc stuff would fix the compile error, but I'm actually interested in those type parameters.
So this is now more a suggestion to expose
getEffectiveTypeParameterDeclarationsmhegazy commentedon May 19, 2018
that makes sense. a PR would be appreciated.. Nathan Shively-Sanders (@sandersn) any concerns?
sandersn commentedon May 21, 2018
Ideally we would have either
getTypeParametersso Klaus Meinhardt (@ajafff) doesn't even have to write it.Non-ideally, we would
3. Expose
getEffecitveTypeParmaeterDeclarations.(1) would break existing users of the typeParameters property. (2) might or might not be feasible. I lean toward (3) but I'm not sure how bad the break of (1) is.
[-]API: Property 'typeParameters' does not exist on type 'DeclarationWithTypeParameters'.[/-][+]API: expose getEffectiveTypeParameterDeclarations[/+]ajafff commentedon Jun 4, 2018
Now that #24600 added more logic to
getEffectiveTypeParameterDeclarations, I'm even more in the need of a public API for that purpose. I don't want to duplicate all that code.ajafff commentedon Jun 13, 2018
Nathan Shively-Sanders (@sandersn) any chance this will make it into the 3.0.0 release? Otherwise I will probably rebuild that logic as part of my library
tsutils.sandersn commentedon Jun 13, 2018
Very high chance. However, the public API is temporarily broken because of the new build system, but that should be resolved in a day or two.
In the meantime, I assigned myself so I don't forget and also added the help wanted tag in case somebody will have time to fix it before I do.