최상위 10_Wiki/Topic_*였던 4개 카테고리 폴더를 10_Wiki/Topics/Topic_* 로 재배치.
콘텐츠 변경 없음(순수 폴더 이동) — Topics/ 하위 나머지 폴더는 이미 지난 커밋에서
전부 정리된 상태(잔존 항목은 에이전트 운영 상태 및 사용자가 보존을 요청한
업데이트0615/무제 3.canvas 뿐).
"매 compile-time 매 immutability marker — runtime enforcement 의 X". 매 TS 의 의 의 mutation prevention 의 의 매 type-system level — readonly keyword, Readonly<T>, ReadonlyArray<T>, as const 매 4 가지 form. 매 runtime freeze 가 의 매 Object.freeze 의 의.
Mapped type: Readonly<T> — all props readonly (shallow).
Array variants: readonly T[] 또는 ReadonlyArray<T> — no .push, .pop, etc.
as const: literal narrowing + deep readonly tuple/object literal.
매 핵심 행동
매 compile-time only — JS runtime 의 의 effect 의 X.
Variance: T[] is assignable to readonly T[] (covariant), but not vice-versa.
Shallow: Readonly<{ a: { b: 1 } }> 매 a is readonly, a.b 의 X.
매 응용
Public API: function param 매 readonly T[] — caller 의 mutation 의 의 의 의.
Redux / Zustand state — 매 immutability invariant.
Config object — as const 매 literal type.
Tuple destructuring — const point = [1, 2] as const.
Discriminated union literals — type Status = "ok" | "fail" via as const.
💻 패턴
Property readonly
interfaceUser{readonlyid: string;name: string}constu: User={id:"1",name:"A"};u.name="B";// OK
u.id="2";// Error: cannot assign to 'id' because it is a read-only