devtypes - v1.1.0
    Preparing search index...

    Type Alias ReadonlyProperties<T>

    ReadonlyProperties: Pick<T, ReadonlyPropertyNames<T>>

    Extract 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 = ReadonlyPropertiesObject< Settings >;
    // { theme: string; language: string; }