devtypes - v2.0.0
    Preparing search index...

    Type Alias ReadonlyProperties<T>

    ReadonlyProperties: Pick<T, ReadonlyPropertyNames<T>>

    Extract public readonly properties from a class as an object.

    Type Parameters

    • T

      A class or object type

    Produces an object type containing all readonly properties. Useful for creating immutable views or snapshots of a class instance.

    class Settings { readonly theme = 'dark'; readonly language = 'en'; }
    type ReadonlyPropsObj = ReadonlyProperties< Settings >;
    // { theme: string; language: string; }