microsoft / microsoft/TypeScript
Docs - I am able to add new add new items to top level scope, contrary to what doc mention.
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Search Terms: Documentation
Typescript Version: 3.5.3
Documentation here and here mention, "Neither module augmentations nor global augmentations can add new items to the top level scope - they can only “patch” existing declarations.", however I am able to "add new items".
//file-a.ts
import * as moment from 'moment';
declare module "moment" {
interface GoblyGoop {
name: string;
}
}
let y: moment.GoblyGoop;
//file-b.ts
import * as moment from 'moment';
let y: moment.GoblyGoop;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the linked sections on augmenting global/module scope and declaration merging, then reproduce the TypeScript 3.5.3 example using file-a.ts and file-b.ts. Confirm whether the example contradicts the documented limitation, and update the relevant handbook wording or add an explanation so the documented behavior matches the result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100