Fix: Restore unified Topics folder and reorganize specialized category folders
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
---
|
||||
id: [[P-Reinforce|P-Reinforce]]-TS-AMBIENT
|
||||
category: Dev
|
||||
confidence_score: 0.98
|
||||
tags: [TypeScript, [[Ambient Declarations|Ambient Declarations]], dts, Coding Standards]
|
||||
last_reinforced: 2026-04-20
|
||||
---
|
||||
|
||||
# [[Ambient-Declarations|Ambient-Declarations]] (앰비언트 선언)
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "존재하지만 실체는 없는 것들에 대한 증명." 타입스크립트 컴파일러에게 "이 변수나 함수는 외부에 이미 있으니 타입만 믿고 통과시켜라"라고 알려주는 `declare` 키워드의 본질이다.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
- **declare keyword**:
|
||||
- 실제 컴파일된 JS 파일에는 포함되지 않지만, 타입 전용 공간에서 전역 변수나 라이브러리의 구조를 선언할 때 사용한다.
|
||||
- **.d.ts files**:
|
||||
- 앰비언트 선언들이 모여 있는 파일. 프로젝트 전체에 걸쳐 전역적인 타입 정보를 제공하는 '타입 명세서' 역할을 한다.
|
||||
- **External Library Integration**:
|
||||
- 타입 정보가 없는 레거시 JS 라이브러리를 타입스크립트 프로젝트에서 에러 없이 사용하기 위한 필수 관문이다.
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (RL Update)
|
||||
- 무분별한 앰비언트 선언은 전역 네임스페이스를 오염시킨다. 현대적 가이드라인은 가능하면 `Module Augmentation`을 사용하거나 `@types` 패키지를 통해 엄격하게 관리하는 것을 권장한다.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- Related: [[Declaration-Files|Declaration-Files]] , Module-Augmentation
|
||||
- Standard: [[Branded-Types-for-Nominal-Typing|Branded-Types-for-Nominal-Typing]]
|
||||
Reference in New Issue
Block a user