We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is the demo code on your website
/** @template [T=object] */ class Cache { // hover `Cache` to see: 'class Cache <T = object>' /** @param {T} initial */ constructor(T) { } } let c = new Cache()
When I copy those code, and use tsc to generate a .d.ts file. In that .d.ts file, Cache dose not have a generate template.
Cache
demo repo
output .d.ts:
There is no template defaults, and event no template.
/** @template [T=object] */ export class Cache { /** @param {T} initial */ constructor(T: any); }
output .d.ts should be:
/** @template [T=object] */ export class Cache<T = object> { /** @param {T} initial */ constructor(T: any); }
The text was updated successfully, but these errors were encountered:
There is typo in code constructor(T) should be constructor(initial) (same as in handbook)
constructor(T)
constructor(initial)
And with PR merged on September 9 I think it's implemented only in 4.5. In 4.4.4 you should see an error for [ character. Works in 4.5.0-beta
[
Sorry, something went wrong.
I think it would be better to document a feature after it been released. 🙂
And by the way I'm really exciting about this feature. ❤️
No branches or pull requests
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
💻 Code
This is the demo code on your website
When I copy those code, and use tsc to generate a .d.ts file. In that .d.ts file,
Cache
dose not have a generate template.demo repo
🙁 Actual behavior
output .d.ts:
There is no template defaults, and event no template.
🙂 Expected behavior
output .d.ts should be:
The text was updated successfully, but these errors were encountered: