devtypes - v1.1.0
    Preparing search index...

    Type Alias ReadonlyProperty<T, K>

    ReadonlyProperty: Omit<T, K> & Readonly<Pick<T, K>>

    Make a specific property readonly.

    Type Parameters

    • T

      The object type

    • K extends keyof T

      The key of the property to make readonly

    1.1.0

    Marks only one property as readonly while keeping all others mutable. Useful for enforcing immutability at the type level.

    type Obj = { a: string; b: number };
    type Result = ReadonlyProperty< Obj, 'a' >; // { readonly a: string; b: number }