This repository has been archived on 2025-07-07. You can view files and clone it, but cannot push or open issues or pull requests.
Files
eternos/frontend/style/node_modules/next/dist/shared/lib/deep-readonly.d.ts
2025-01-11 09:54:09 +03:00

9 lines
389 B
TypeScript

/**
* A type that represents a deeply readonly object. This is similar to
* TypeScript's `Readonly` type, but it recursively applies the `readonly`
* modifier to all properties of an object and all elements of arrays.
*/
export type DeepReadonly<T> = T extends (infer R)[] ? ReadonlyArray<DeepReadonly<R>> : T extends object ? {
readonly [K in keyof T]: DeepReadonly<T[K]>;
} : T;