microsoft / microsoft/TypeScript

Documentation: Clarify declaration files and the declare keyword

Offen
#23,262 2 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Docs
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

TypeScript Version: 2.8.0

Search Terms:
document declaration files

** Issue**
It doesn't look like you actually define what a declaration file is in your documentation. For instance, your introduction to these at https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html tells me you're going to help me learn how to write them, but not what they are or why I'd want one. But, I don't think this makes it easy for a newbie to understand.

Similarly, you don't seem to explain when the declare keyword is, or when it should be used (as far as I can tell, it is used when you need to tell the compiler that the module/library/whatever has a value of some type).

You also seem to make some references to the global namespace (declare global { ... })), but don't seem to directly explain it anywhere.

Code
n/a

Expected behavior:
n/a

Actual behavior:
n/a

Playground Link:
n/a

Related Issues:
n/a

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Einführung in die Declaration Files unter https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html und verfolge anschließend deren Verweise auf declare global und verwandte Anleitungen zu Declaration Files. Prüfe das umgebende Handbook-Material, bevor du Änderungen vornimmst. Erledigt ist die Aufgabe, wenn die Dokumentation Declaration Files klar definiert, erklärt, warum und wann declare verwendet werden sollte, und den globalen Namespace direkt erläutert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.