[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-04-30 22:42:02 +09:00
parent 0bd4f19e38
commit c36c0644a1
4888 changed files with 18470 additions and 18602 deletions
+5 -5
View File
@@ -1,8 +1,8 @@
---
id: P-REINFORCE-AI-DECLARATION-FILES
id: [[P-Reinforce]]-AI-DECLARATION-FILES
category: "10_Wiki/💡 Topics/AI"
confidence_score: 0.99
tags: [TypeScript, JavaScript, DeclarationFiles, Tooling]
tags: [TypeScript, [[JavaScript]], DeclarationFiles, Tooling]
last_reinforced: 2026-04-20
---
@@ -15,9 +15,9 @@ last_reinforced: 2026-04-20
- **Extension**: `.d.ts` (d는 declaration의 약자).
- **Core Role**:
- **Bridge**: 컴파일된 JS 파일 옆에서 해당 코드의 타입을 설명함.
- **Library Support**: 직접 TS로 쓰이지 않은 NPM 패키지들에 타입을 부여함.
- **Ambient Declarations**: `window``process` 같은 전역 객체에 타입을 추가하는 용도.
- **Compiler behavior**: 런타임에는 아무런 영향을 주지 않으며, 오직 '에디터'와 '컴파일 타임'의 안정성만을 위해 존재한다.
- **Library [[Support]]**: 직접 TS로 쓰이지 않은 NPM 패키지들에 타입을 부여함.
- **[[Ambient Declarations]]**: `window``process` 같은 전역 객체에 타입을 추가하는 용도.
- **Compiler [[Behavior]]**: 런타임에는 아무런 영향을 주지 않으며, 오직 '에디터'와 '컴파일 타임'의 안정성만을 위해 존재한다.
## ⚠️ 모순 및 업데이트 (RL Update)
- 선언 파일과 실제 JS 코드가 불일치(Out-of-sync)할 때 발생하는 '거짓 안전(False sense of security)'이 가장 위험하다. 이를 방지하기 위해 라이브러리 제작자는 `tsc`를 통해 구현부에서 타입을 자동 추출(emitDeclarationOnly)하는 방식을 지향해야 한다.