basarat / basarat/typescript-book

Using Generic types at runtime

Open Beginner friendly
#141 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.