import { Extends } from '../../commonness/Extends'; import { If } from '../../commonness/If'; import { Tuple } from '../../primitive/Tuple'; /** * * Make all properties of an object read-only * * 객체의 모든 속성을 읽기 전용으로 만드는 타입 * * @param T Object / 객체 * * @returns DeepReadonly object / 읽기 전용 객체 * * @example * type X = { x: { y: { z: string } } }; * * type cases = [ * Expect, { readonly x: { readonly y: { readonly z: string } } }>>, * ] * * @link https://www.utilscript.site/docs/usage-object/deep-readonly * */ export type DeepReadonly = { readonly [k in keyof T]: T[k] extends Record ? If unknown>, T[k], DeepReadonly> : T[k]; };