Type Alias DeepReadonly<T>

DeepReadonly<T>: {
    readonly [P in keyof T]: T[P] extends (infer U)[]
        ? DeepReadonly<U>[]
        : T[P] extends object
            ? DeepReadonly<T[P]>
            : T[P]
}

Utility to make a deep "readonly" of an existing type.

Type Parameters

  • T

    The type to make a readonly of.