basarat / basarat/typescript-book
Using Generic types at runtime
- Dominant language
- TypeScript
- Stars
- 21.6k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
TypeScript types are compile time only. Generic parameters only exist in the _type_ declaration space and cannot be used as is in the _variable_ declaration space. Mention the workarounds :rose:
This is good section to put it into : https://basarat.gitbooks.io/typescript/content/docs/project/declarationspaces.html
Contributor guide
Research direction
Start with the declarationspaces section at https://basarat.gitbooks.io/typescript/content/docs/project/declarationspaces.html and review how it distinguishes type and variable declaration spaces. Document that generic parameters exist only at compile time and explain the relevant workarounds. Done means the section clearly covers runtime limitations and practical alternatives.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100